示例#1
0
 public RespawnPoint(MyVector pos, MyVector rotation, GameTeam team)
 {
     position = pos;
     timeSinceUse = RespawnCooldown;
     orientation = MyQuaternion.FromEulerAngles(rotation.X, rotation.Y, rotation.Z);
     this.team = team;
 }
        public CharacterController(Character character)
        {
            this.character = character;
            initialOrientation = character.Orientation;

            Reset(character);
            Update(0, 0, 0, 0, 0);
        }
示例#3
0
 public WeaponPickup(WeaponClass w,MyVector pos,MyQuaternion orientation)
     : base(new PhysicalProperties(0,0))
 {
     weaponClass = w;
     StaticBodyData data = this.StaticBodyData;
     data.Position = pos;
     data.Orientation = orientation;
     this.StaticBodyData = data;
     timeSinceLastUse = weaponClass.PickupReuseTime;
 }
示例#4
0
        public Arrow(object owner, WeaponClass weaponClass, MyVector position, MyQuaternion orientation, MyVector velocity)
            : base(new PhysicalProperties(0, 0, 0))
        {
            this.owner = owner;
            this.weaponClass = weaponClass;

            PointMassData data = this.PointMassData;

            data.Position = position;
            data.Orientation = orientation;
            data.Velocity = velocity;
            data.Mass = 0;
            this.PointMassData = data;
            remainingTime = weaponClass.WeaponParameters.ParticleLifetime;
        }
示例#5
0
 public abstract IMissile GetMissile(object owner, MyVector position, MyQuaternion orientation);
示例#6
0
 public RespawnPoint(MyVector pos)
 {
     position = pos;
     timeSinceUse = RespawnCooldown;
     orientation = MyQuaternion.FromEulerAngles(0, 0, 0);
 }
示例#7
0
 public MyQuaternion Rotate(MyQuaternion q)
 {
     MyQuaternion t = (q) * (this) * (~q);
     n = t.n;
     v = t.v;
     return this;
 }
示例#8
0
        public static MyQuaternion FromEulerAngles(float roll, float pitch, float yaw)
        {
            double cyaw, cpitch, croll, syaw, spitch, sroll;
            double cyawcpitch, syawspitch, cyawspitch, syawcpitch;

            cyaw = Math.Cos(yaw / 2);
            cpitch = Math.Cos(pitch / 2);
            croll = Math.Cos(roll / 2);
            syaw = Math.Sin(yaw / 2);
            spitch = Math.Sin(pitch / 2);
            sroll = Math.Sin(roll / 2);

            cyawcpitch = cyaw * cpitch;
            syawspitch = syaw * spitch;
            cyawspitch = cyaw * spitch;
            syawcpitch = syaw * cpitch;

            MyQuaternion q = new MyQuaternion();
            q.n = (float)(cyawcpitch * croll + syawspitch * sroll);
            q.v.X = (float)(cyawcpitch * sroll - syawspitch * croll);
            q.v.Y = (float)(cyawspitch * croll + syawcpitch * sroll);
            q.v.Z = (float)(syawcpitch * croll - cyawspitch * sroll);
            return q;
        }
示例#9
0
 public static MyQuaternion FromAxisAngle(float angle, MyVector axis)
 {
     MyQuaternion q = new MyQuaternion();
     q.n = (float)Math.Cos(angle / 2);
     q.v.X = axis.X * ((float)Math.Sin(angle / 2));
     q.v.Y = axis.Y * ((float)Math.Sin(angle / 2));
     q.v.Z = axis.Z * ((float)Math.Sin(angle / 2));
     return q;
 }
示例#10
0
        public ICollisionData Rotate(MyQuaternion orientation)
        {
            for (int i = 0; i < m_vertices.Length; i++)
            {
                m_vertices[i].Rotate(orientation);
            }
            for (int i = 0; i < m_hardPoints.Length; i++)
            {
                m_hardPoints[i].Rotate(orientation);
            }
            for (int i = 0; i < m_faces.Length; i++)
            {
                m_faces[i].n.Rotate(orientation);
            }

            MeshRotation.Rotate(orientation);
            return this;
        }
示例#11
0
 public static MyQuaternion operator *(float s, MyQuaternion q)
 {
     MyQuaternion nq = new MyQuaternion(q.n, q.v);
     nq.Multiply(s);
     return nq;
 }
        public virtual void Reset(Character character)
        {
            this.character = character;
            //this.xDeltaAvg
            this.strafeSpeedX = 0;
            strafeX = 0;
            turnSpeedX = 0;
            turnSpeedY = 0;

            turnX = 0;
            turnY = 0;

            rollSpeed = 0;
            velocity = 0;

            angleX = 0;
            angleY = 0;

            initialOrientation = character.Orientation;
            initialLook = (new MyVector(0, 0, -1)).Rotate(initialOrientation);
            initialUp = (new MyVector(0, 1, 0)).Rotate(initialOrientation);
            initialRight = (new MyVector(1, 0, 0)).Rotate(initialOrientation);

            upVector = initialUp;
        }
        public virtual void Reset()
        {
            //this.xDeltaAvg
            this.strafeSpeedX = 0;
            strafeX = 0;
            turnSpeedX = 0;
            turnSpeedY = 0;

            turnX = 0;
            turnY = 0;

            rollSpeed = 0;
            velocity = 0;
            angleX = 0;
            angleY = 0;

            initialOrientation = MyQuaternion.FromEulerAngles(0, 0, 0);
            initialLook = (new MyVector(0, 0, -1)).Rotate(initialOrientation);
            initialUp = (new MyVector(0, 1, 0)).Rotate(initialOrientation);
            initialRight = (new MyVector(1, 0, 0)).Rotate(initialOrientation);
        }
示例#14
0
 public MyVector Rotate(MyQuaternion q)
 {
     MyQuaternion t = (q) * (this) * (~q);
     x = t.Vector.X;
     y = t.Vector.Y;
     z = t.Vector.Z;
     return this;
 }
示例#15
0
 public ICollisionData Rotate(MyQuaternion orientation)
 {
     this.Normal.Rotate(orientation);
     return this;
 }
示例#16
0
 public WeaponPickup GetWeaponPickup(MyVector position, MyQuaternion orientation)
 {
     WeaponPickup w = new WeaponPickup(this, position, orientation);
     return w;
 }
示例#17
0
 public SwordBlade(object owner, WeaponClass weaponClass, MyVector position, MyQuaternion orientation, MyVector velocity)
     : base(new PhysicalProperties(0, 0, 0))
 {
 }
示例#18
0
 public static MyQuaternion operator /(MyQuaternion q, float s)
 {
     MyQuaternion nq = new MyQuaternion(q.n, q.v);
     nq.Divide(s);
     return nq;
 }