Report any bugs here and we'll post fixes
Moderators: Sascha Willems, Thomas
by Lax » Wed Dec 16, 2020 12:25 pm
Hi Julio,
I found a weird crash. I'm using a spaceship model as kinematic body. On that ship there is a cannon (body), which uses a hingejoint with the spaceshipe (kinematic body) as parent.
Now after my simulation is ended I get a crash in
NewtonBodySetMatrix(m_body, &matrix[0]);
because internally, the body pointer is *.
When I use a usual body for the spaceship and create the joint, everything does work as expected.
So it has something todo, that a joint is mixed with body and kinematic body.
Do you have a clue, what is happening here?
Best Regards
Lax
-
Lax
-
- Posts: 165
- Joined: Sat Jan 08, 2011 8:24 am
by Julio Jerez » Wed Dec 16, 2020 1:21 pm
Kinematic bodies are not allowed to be linked to other bodies by joints.
For that there is the kinematic joint.
Make the ship a dynamic body.
Then add at kinematic joint.
Then you control the body by setting the target matrix of the kinematic joint
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by Lax » Wed Dec 16, 2020 4:43 pm
Ahh ok. The strange thing was, that it worked, the hinge could be rotated^^. The crash occured on destruction. And because of that, I thought, that it will work.
Thanks for clarification!
-
Lax
-
- Posts: 165
- Joined: Sat Jan 08, 2011 8:24 am
by Julio Jerez » Wed Dec 16, 2020 6:18 pm
I works on some cases but that's because some loophole in the engine logic. there probably some assert you are ignoring. Kinematic bodies are designed primarily for triggers in 3.14. they do not get dynamics updates only collision. so the behave like object attached to static bodies.
in 4.0 they are the actual base class for all objects, so joints can be attached to them, but 4.00 is too young still to be use in production.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
Return to Bugs and Fixes
Who is online
Users browsing this forum: No registered users and 19 guests