Exemplo n.º 1
0
        public void updateFromPoint(ClothPoint point, IWorldAccessor world)
        {
            PointIndex = point.PointIndex;
            Mass       = point.Mass;
            InvMass    = point.InvMass;
            Pos.Set(point.Pos);
            Velocity.Set(point.Pos);
            Tension.Set(point.Tension);
            GravityStrength  = point.GravityStrength;
            pinned           = point.pinned;
            pinnedToEntityId = point.pinnedToEntityId;
            if (pinnedToEntityId != 0)
            {
                pinnedTo = world.GetEntityById(pinnedToEntityId);
                if (pinnedTo != null)
                {
                    PinTo(pinnedTo, pinnedToOffset);
                }
                else
                {
                    UnPin();
                }
            }

            pinnedToBlockPos = pinnedToBlockPos.SetOrCreate(point.pinnedToBlockPos);
            pinnedToOffset   = pinnedToOffset.SetOrCreate(point.pinnedToOffset);

            pinnedToOffsetStartYaw = point.pinnedToOffsetStartYaw;
        }