コード例 #1
0
ファイル: RigidBody.cs プロジェクト: yuruyigit/TrueSync
        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();
        }
コード例 #2
0
ファイル: SoftBody.cs プロジェクト: yuruyigit/TrueSync
 public MassPoint(Shape shape, SoftBody owner, BodyMaterial material) : base(shape, material, true)
 {
     this.SoftBody = owner;
 }
コード例 #3
0
ファイル: RigidBody.cs プロジェクト: yuruyigit/TrueSync
 public RigidBody(Shape shape, BodyMaterial material) : this(shape, material, false)
 {
 }