Ejemplo n.º 1
0
 public Matrix4 getPositionalMatrix(Matrix4 offset)
 {
     lock (this.location) {
         Location l = this.getLocation().clone();
         Matrix4  positionMatrix = Matrix4.Transformation(
             l.getAsVector(),
             l.getRotationQuaternion(),
             new Vector3((float)this.scaleX, (float)this.scaleY, (float)this.scaleZ)
             );
         l.Dispose();
         return(offset * positionMatrix);
     }
 }
Ejemplo n.º 2
0
		public Matrix4 getViewMatrix() {
			if(!this.vmnr) return this.viewMatrix;
			Location l = this.getLocation().clone();
			Location t = this.getTarget().clone();
			this.viewMatrix = Matrix4.LookAt(
				l.getAsVector(),
				t.getAsVector(),
				new Vector3(0,1,0)
			);
			l.Dispose();
			t.Dispose();
			return this.viewMatrix;
		}