public static CCollisionConvexPrimitives[] GetNewtonCollisions(ICollection<ConvexCollisionMask> collisions) { int i = 0; CCollisionConvexPrimitives[] handles = new CCollisionConvexPrimitives[collisions.Count]; foreach (ConvexCollisionMask c in collisions) { handles[i++] = c.NewtonCollision; } return handles; }
public CCollisionConvexPrimitives CreateConvexHullModifier() { CheckHandle(); MakeUnique(); CCollisionConvexPrimitives modifier = new CCollisionConvexPrimitives(m_World); modifier.m_Handle = Newton.NewtonCreateConvexHullModifier(m_World.Handle, m_Handle); CHashTables.Collision.Add(modifier.m_Handle, modifier); return(modifier); }
protected override CCollision OnInitialise() { base.OnInitialise(); if (!(this.Geometry is MeshGeometry3D)) throw new InvalidOperationException("Only MeshGeometry3D supported."); _points = GeometryHelper.GetGeometryPoints((MeshGeometry3D)this.Geometry, Matrix3D.Identity); if (_points == null) throw new InvalidOperationException("The MeshGeometry3D contains no geometry."); CCollisionConvexPrimitives collision = new CCollisionConvexPrimitives(this.World.NewtonWorld); collision.CreateConvexHull(_points, Matrix3D.Identity); return collision; }
public CCollisionConvexPrimitives CreateConvexHullModifier() { CheckHandle(); MakeUnique(); CCollisionConvexPrimitives modifier = new CCollisionConvexPrimitives(m_World); modifier.m_Handle = Newton.NewtonCreateConvexHullModifier(m_World.Handle, m_Handle); CHashTables.Collision.Add(modifier.m_Handle, modifier); return modifier; }
protected override CCollision OnInitialise() { CCollisionConvexPrimitives collision = new CCollisionConvexPrimitives(this.World.NewtonWorld); collision.CreateNull(); return collision; }