public PxGhRigidDynamicSphere(Plane frame, float radius, Material material, float mass, Vector3d initialLinearVelocity, Vector3d initialAngularVelocity) : base(frame, initialLinearVelocity, initialAngularVelocity) { Actor.CreateShape(new SphereGeometry(radius), material); Mass = mass; DisplayMeshes.Add(Mesh.CreateFromSphere(new Sphere(Point3d.Origin, radius), 12, 6)); }
public PxGhRigidStaticBox(Plane frame, float length, float width, float height, Material material) { Actor.CreateShape(new BoxGeometry(length * 0.5f, width * 0.5f, height * 0.5f), material); Actor.GlobalPose = frame.ToMatrix(); DisplayMeshes.Add( Mesh.CreateFromBox( new Box( frame, new BoundingBox(-length * 0.5f, -width * 0.5f, -height * 0.5f, length * 0.5f, width * 0.5f, height * 0.5f)), 1, 1, 1)); }
public PxGhRigidStaticBox(Box box, Material material) { Point3d max = box.BoundingBox.Max; Point3d min = box.BoundingBox.Min; float length = (float)(max.X - min.X); float width = (float)(max.Y - min.Y); float height = (float)(max.Z - min.Z); Actor.CreateShape(new BoxGeometry(length * 0.5f, width * 0.5f, height * 0.5f), material); Actor.GlobalPose = box.Plane.ToMatrix(); DisplayMeshes.Add(Mesh.CreateFromBox(box, 1, 1, 1)); }
public PxGhRigidDynamicBox( Plane frame, float length, float width, float height, Material material, float mass, Vector3d initialLinearVelocity, Vector3d initialAngularVelocity) : base( frame, initialLinearVelocity, initialAngularVelocity) { Actor.CreateShape(new BoxGeometry(length * 0.5f, width * 0.5f, height * 0.5f), material); Mass = mass; hX = length * 0.5f; hY = width * 0.5f; hZ = height * 0.5f; DisplayMeshes.Add(Mesh.CreateFromBox(new BoundingBox(-hX, -hY, -hZ, hX, hY, hZ), 1, 1, 1)); }
public PxGhRigidStaticSphere(Plane frame, float radius, Material material) { Actor.CreateShape(new SphereGeometry(radius), material); Actor.GlobalPose = frame.ToMatrix(); DisplayMeshes.Add(Mesh.CreateFromSphere(new Sphere(frame, radius), 32, 16)); }