public RigidBody(Shape shape, BodyMaterial material, bool isParticle) { this.readOnlyArbiters = new ReadOnlyHashset <Arbiter>(this.arbiters); this.readOnlyConstraints = new ReadOnlyHashset <Constraint>(this.constraints); RigidBody.instanceCount++; this.instance = RigidBody.instanceCount; this.hashCode = this.CalculateHash(this.instance); this.Shape = shape; this.orientation = TSMatrix.Identity; bool flag = !isParticle; if (flag) { this.updatedHandler = new ShapeUpdatedHandler(this.ShapeUpdated); this.Shape.ShapeUpdated += this.updatedHandler; this.SetMassProperties(); } else { this.inertia = TSMatrix.Zero; this.invInertia = (this.invInertiaWorld = TSMatrix.Zero); this.invOrientation = (this.orientation = TSMatrix.Identity); this.inverseMass = FP.One; } this.material = material; this.AllowDeactivation = true; this.EnableSpeculativeContacts = false; this.isParticle = isParticle; this.Update(); }
public MassPoint(Shape shape, SoftBody owner, BodyMaterial material) : base(shape, material, true) { this.SoftBody = owner; }
public RigidBody(Shape shape, BodyMaterial material) : this(shape, material, false) { }