A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by tshannon » Fri Oct 12, 2012 12:57 pm
I was seeing references to Collisions being instanced in newton 300, and due to that a collision pointer won't necessarily be the same in a callback.
I just want to confirm that this is just for collisions, and not other types like bodys or joints? If it is, then I'll need to change how I'm handling the connections between go objects and C objects. Or should I just be safe and store all of my Go object pointers in the userData for all types?
-
tshannon
-
- Posts: 22
- Joined: Wed Sep 05, 2012 3:21 pm
by Julio Jerez » Fri Oct 12, 2012 1:30 pm
This only apply to collsion objects
tshannon wrote:If it is, then I'll need to change how I'm handling the connections between go objects and C objects. Or should I just be safe and store all of my Go object pointers in the userData for all types?
I do not undertand that part of the question.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by tshannon » Fri Oct 12, 2012 2:00 pm
Your answer to my first question makes the 2nd one uncessary, but basically due to the way Go handles callbacks from C code, I need to keep track of a Go created object, and make sure it references the C created object properly.
If I couldn't trust the C pointers to refer to the same Go object, then I would need to store the Go object pointers in the userData variable of a given C object (Body, World, Joint, etc).
But like I said, since the pointer to a NewtonBody will always reflect the same body, then I'm fine.
Thanks,
-
tshannon
-
- Posts: 22
- Joined: Wed Sep 05, 2012 3:21 pm
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 2 guests