-
I'm trying to use Jolt Physics in my C++ game but run into an issue at runtime.
I have:
I have noticed that mShapePtr in JPH::BoxShapeSettings settings in PhysicsEngine::addBody is set but not mShape but I don't know why... Is there something I miss? Here is some code from my project:
I have tried to set a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
you can provide either to the This should not compile because
If you pass a pointer to a
|
Beta Was this translation helpful? Give feedback.
mShapePtr
contains theShape
object as it will be used by the enginemShape
contains aShapeSettings
object that is used to create theShape
you can provide either to the
BodyCreationSettings
constructor and it will make sure that by the time the body is added an actualShape
is created.This should not compile because
Shape
is a pure virtual class:If you pass a pointer to a
Ref
then lifetime is managed by it and you should not calldelete
: