-
I have been able to successfully create a variety of shapes - spheres, boxes, capsules, convex hulls (singular). Now I want to create a Compound shape composed of multiple convex hulls.. the purpose of this would be to create a volume of water, for example, and be able to tell on each Update() whether the player is inside the water or not. I feel like I might just be making one small mistake here that causes the shape to not be properly created or added to the physics system. I tried to find a sample in the repository, but the only compound shape examples I could find were for doing shape or ray cast tests. ` // Create compond convex hull using VHACD VHACD::IVHACD::Parameters params; iface->Compute(info->vertices, info->numVertices, info->indices, info->numTriangles, params); uint32_t j;
} delete info; JPH::BodyCreationSettings bcs(css.Create().Get(), mat.GetTranslation(), mat.GetRotation().GetQuaternion(), JPH::EMotionType::Kinematic, Layers::POLYOBJS); bcs.mOverrideMassProperties = JPH::EOverrideMassProperties::MassAndInertiaProvided; object->collisionObjectID = bi.CreateAndAddBody(bcs, JPH::EActivation::Activate);` |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It looks like you're double transforming by using mat.GetTranslation/Rotation on both the body and each of the subshapes |
Beta Was this translation helpful? Give feedback.
It looks like you're double transforming by using mat.GetTranslation/Rotation on both the body and each of the subshapes