internal virtual void CreateFixture() { if (_fixture != null) { return; } FSRigidBody rigidBody = this.GetComponent <FSRigidBody>(); if (rigidBody == null || rigidBody.Body == null) { return; } Body body = rigidBody.Body; _fixtureDef.Shape.Density = _fixtureDef.Density; _fixture = body.CreateFixture(_fixtureDef.Shape, this); _fixture.Friction = _fixtureDef.Friction; _fixture.Restitution = _fixtureDef.Restitution; _fixture.IsSensor = _fixtureDef.IsSensor; _fixture.CollidesWith = _fixtureDef.CollidesWith; _fixture.CollisionCategories = _fixtureDef.CollisionCategories; _fixture.IgnoreCCDWith = _fixtureDef.IgnoreCCDWith; _fixture.CollisionGroup = _fixtureDef.CollisionGroup; }
internal virtual void DestroyFixture() { if (_fixture == null) { return; } FSRigidBody rigidBody = this.GetComponent <FSRigidBody>(); if (rigidBody == null || rigidBody.Body == null) { return; } rigidBody.Body.DestroyFixture(_fixture); _fixture = null; }
public override void onAddedToEntity() { _ownerBody = this.getComponent <FSRigidBody>(); Assert.isNotNull(_ownerBody, "Joint added to an Entity with no RigidBody!"); createJoint(); }
public FSJoint setOtherBody(FSRigidBody otherBody) { _otherBody = otherBody; recreateJoint(); return(this); }
public FSJoint SetOtherBody(FSRigidBody otherBody) { _otherBody = otherBody; RecreateJoint(); return this; }
public override void OnAddedToEntity() { _ownerBody = this.GetComponent<FSRigidBody>(); Insist.IsNotNull(_ownerBody, "Joint added to an Entity with no RigidBody!"); CreateJoint(); }
public override void onAddedToEntity() { _ownerBody = this.getComponent<FSRigidBody>(); Assert.isNotNull( _ownerBody, "Joint added to an Entity with no RigidBody!" ); createJoint(); }
public FSJoint setOtherBody( FSRigidBody otherBody ) { _otherBody = otherBody; recreateJoint(); return this; }