상속: Component, IUpdatable
        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;
        }
예제 #3
0
 public override void onAddedToEntity()
 {
     _ownerBody = this.getComponent <FSRigidBody>();
     Assert.isNotNull(_ownerBody, "Joint added to an Entity with no RigidBody!");
     createJoint();
 }
예제 #4
0
 public FSJoint setOtherBody(FSRigidBody otherBody)
 {
     _otherBody = otherBody;
     recreateJoint();
     return(this);
 }
예제 #5
0
 public FSJoint SetOtherBody(FSRigidBody otherBody)
 {
     _otherBody = otherBody;
     RecreateJoint();
     return this;
 }
예제 #6
0
 public override void OnAddedToEntity()
 {
     _ownerBody = this.GetComponent<FSRigidBody>();
     Insist.IsNotNull(_ownerBody, "Joint added to an Entity with no RigidBody!");
     CreateJoint();
 }
예제 #7
0
파일: FSJoint.cs 프로젝트: prime31/Nez
		public override void onAddedToEntity()
		{
			_ownerBody = this.getComponent<FSRigidBody>();
			Assert.isNotNull( _ownerBody, "Joint added to an Entity with no RigidBody!" );
			createJoint();
		}
예제 #8
0
파일: FSJoint.cs 프로젝트: prime31/Nez
		public FSJoint setOtherBody( FSRigidBody otherBody )
		{
			_otherBody = otherBody;
			recreateJoint();
			return this;
		}