And the “unit” is displayed at (0,0,0),
the set_pos doesn’t effect it…
When I print the: “unit.get_pos()” it’s give me the one I set (meaning (100,100,0)).
So why does it display the model at (0,0,0) and not at (100,100,0) as i asked…?
Ah, another problem may be the way you are declaring your RBC. Unlike NodePath, RigidBodyCombiner inherits from PandaNode, which inherits from ReferenceCount. All objects that inherit from ReferenceCount must be declared dynamically and stored in a PT() object.
So, you should replace:
RigidBodyCombiner rbc("");
with:
PT(RigidBodyCombiner) rbc = new RigidBodyCombiner("");
Also, I note that you reference a different object, _rbc. Make sure that you don’t have two different RigidBodyCombiner objects here that you’re getting confused with each other.
I change the code as you say to PT, and as you say at your first command (the rbcNP is not a pointer any more…), but still the object is at (0,0,0) and won’t move that location !
So I try to replace the model in the same code with the LineSegs object, and it’s work… !!
Can it be the model? some thing in my egg file?
or may be the code line: otherNode.copy_to(unit);
is making the problem?
My code now is looking like this:
[b]NodePath rbcNP;
PT(RigidBodyCombiner)rbc = new RigidBodyCombiner("");