Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsistent description about collision shape #40

Closed
voyagingmk opened this issue Jan 7, 2018 · 1 comment
Closed

inconsistent description about collision shape #40

voyagingmk opened this issue Jan 7, 2018 · 1 comment
Assignees
Milestone

Comments

@voyagingmk
Copy link

User Manual:

First note that when you add a collision shape to a body, the shape will not be copied internally. You only give a pointer to the shape in parameter. The shape must exist during the whole lifetime of the body. This way, you can create a collision shape and reuse it for multiple bodies. You are also responsible to destroy the shape at the end when the bodies are not used anymore.

Testbed Code Comment (common/Sphere.cpp):

// Create the collision shape for the rigid body (sphere shape)
// ReactPhysics3D will clone this object to create an internal one. Therefore,
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
mCollisionShape = new rp3d::SphereShape(mRadius);

The User Manual and code is consistent. But the comment is expired.

@DanielChappuis
Copy link
Owner

Thanks a lot for reporting this. I will correct this for the next release.

@DanielChappuis DanielChappuis self-assigned this Jan 7, 2018
@DanielChappuis DanielChappuis added this to the Version 0.7.0 milestone Jan 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants