本文整理汇总了C++中PhysicsObject::GetActor方法的典型用法代码示例。如果您正苦于以下问题:C++ PhysicsObject::GetActor方法的具体用法?C++ PhysicsObject::GetActor怎么用?C++ PhysicsObject::GetActor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhysicsObject
的用法示例。
在下文中一共展示了PhysicsObject::GetActor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: input
PhysicsObject * PhysicsScene::AddStaticObject(const glm::vec3 * const convexVertices, unsigned int verticesCount, const physx::PxVec3 & position, const physx::PxReal & staticFriction, const physx::PxReal & dynamicFriction, const physx::PxReal & restitution)
{
physx::PxConvexMeshDesc convexDesc;
convexDesc.points.count = verticesCount;
convexDesc.points.stride = sizeof(glm::vec3);
convexDesc.points.data = convexVertices;
convexDesc.flags = physx::PxConvexFlag::eCOMPUTE_CONVEX;
physx::PxDefaultMemoryOutputStream buffer;
if(!m_cooking->cookConvexMesh(convexDesc, buffer))
{
return NULL;
}
physx::PxDefaultMemoryInputData input(buffer.getData(), buffer.getSize());
physx::PxConvexMesh* convexMesh = m_physics->createConvexMesh(input);
PhysicsObject * physicsObject = new PhysicsStaticObject(m_physics, convexMesh, position, staticFriction, dynamicFriction, restitution);
m_physicObjects.push_back(physicsObject);
m_scene->addActor(*(physicsObject->GetActor()));
return physicsObject;
}