Boost logo

Boost Users :

From: andrewperella (ajp_at_[hidden])
Date: 2002-03-08 10:14:38


I am having great trouble with boost python whenever I do anything
slightly more compilcated than the examples.

I have a wrapped a Vector3 class with 3 floats x,y,z.
In python:
 a=m2.Vector3(1,2,3)
 a.x
 1.0
 a.x=100
 a.x
 100.0

This is correct - ie I can disply and modify a.x

Unfortunatedly if wrap another class - Camera which contains a member
variable : Vector3 pos

then I cannot set camera.pos.x
Looking in the debugger, I seem to be getting a copy (in fact
sometime 3 or more copy constructors are called) of pos and I am
modifying this temporary copy!

Help. Surely I can wrap no pointer member variables?
Regards,
Andrew


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net