MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Blast / getMeshScaleForShape

Method getMeshScaleForShape

samples/SampleBase/physx/PhysXController.cpp:781–810  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

779}
780
781PxVec3 PhysXController::getMeshScaleForShape(const PxShape* shape)
782{
783 switch (shape->getGeometryType())
784 {
785 case PxGeometryType::eBOX:
786 {
787 PxBoxGeometry boxGeom;
788 shape->getBoxGeometry(boxGeom);
789 return boxGeom.halfExtents;
790 }
791 case PxGeometryType::ePLANE:
792 {
793 return PxVec3(1, 2000, 2000);
794 }
795 case PxGeometryType::eSPHERE:
796 {
797 PxSphereGeometry sphereGeom;
798 shape->getSphereGeometry(sphereGeom);
799 return PxVec3(sphereGeom.radius, sphereGeom.radius, sphereGeom.radius);
800 }
801 case PxGeometryType::eCONVEXMESH:
802 {
803 PxConvexMeshGeometry convexGeom;
804 shape->getConvexMeshGeometry(convexGeom);
805 return convexGeom.scale.scale; // maybe incorrect because of rotation not used
806 }
807 default:
808 return PxVec3(1, 1, 1);
809 }
810}
811
812
813///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Callers 1

ActorMethod · 0.80

Calls 1

PxVec3Class · 0.50

Tested by

no test coverage detected