示例#1
0
        public Transform(Transform innerTransform = null,
            Vector? translation = null, float rotation = 0.0f, float scale = 1.0f)
        {
            this.innerTransform = innerTransform;

            this.Translation = translation.HasValue ? translation.Value : Vector.Zero;
            this.Rotation = rotation;
            this.Scale = scale;
        }
示例#2
0
 protected bool Equals(Transform other)
 {
     return this.Translation.Equals(other.Translation)
            && this.Rotation.Equals(other.Rotation)
            && this.Scale.Equals(other.Scale)
            && object.Equals(this.innerTransform, other.innerTransform);
 }
示例#3
0
        protected virtual void Update(Transform cumulativeTransform, Transform currentTransform, bool hasRotation)
        {
            if (hasRotation)
            {
                cumulativeTransform.Translation = Vector.Zero.TranslatePolar(currentTransform.Rotation, cumulativeTransform.Translation);
                cumulativeTransform.Translation *= currentTransform.Scale;
                cumulativeTransform.Translation += currentTransform.Translation;
            }
            else
            {
                cumulativeTransform.Translation *= currentTransform.Scale;
                cumulativeTransform.Translation += currentTransform.Translation;
            }

            cumulativeTransform.Scale *= currentTransform.Scale;

            cumulativeTransform.Rotation += currentTransform.Rotation;
        }