예제 #1
0
 public static Matrix CreateBillboard(
     Vector3 objectPosition,
     Vector3 cameraPosition,
     Vector3 cameraUp,
     Vector3? cameraForward)
 {
     return new Matrix(Matrix4x4.CreateBillboard(objectPosition, cameraPosition, cameraUp, cameraForward));
 }
        public DrawableQuad(Vector3 origin, float width, float height, Vector3 normal, Vector3 up, float uvX = 1.0f, float uvY = 1.0f)
        {
            _ready = false;
            vertices = new VertexPositionNormalTexture[4];
            indices = new int[6];
            _origin = origin;
            _normal = normal;
            _up = up;

            _left = Vector3.Cross(_normal, _up);
            Vector3 upperCenter = (_up * height / 2) + origin;
            _upperLeft = upperCenter + (_left * width / 2);
            _upperRight = upperCenter - (_left * width / 2);
            _lowerLeft = _upperLeft - (_up * height);
            _lowerRight = _upperRight - (_up * height);

            FillVertices(uvX,uvY);
        }
예제 #3
0
 public static Vector3 Hermite(Vector3 v1,Vector3 t1, Vector3 v2, Vector3 t2, float amount)
 {
     return new Vector3(Vector.Hermite(v1,t1, v2,t2, amount));
 }
예제 #4
0
 public static float DistanceSquared(Vector3 v1, Vector3 v2)
 {
     return Vector.DistanceSquared(v1, v2);
 }
예제 #5
0
 public static Vector3 Cross(Vector3 v1, Vector3 v2)
 {
     return new Vector3(Vector.Cross(v1, v2));
 }
예제 #6
0
 public static Vector3 Clamp(Vector3 val, Vector3 min,Vector3 max)
 {
     return new Vector3(Vector.Clamp(val, min, max));
 }
예제 #7
0
 public static Vector3 CatmullRom(Vector3 v1, Vector3 v2, Vector3 v3, Vector3 v4, float amount)
 {
     return new Vector3(Vector.CatmullRom(v1, v2, v3, v4, amount));
 }
예제 #8
0
 public static Matrix CreateLookAt(Vector3 pos, Vector3 target, Vector3 up)
 {
     return new Matrix(Matrix4x4.CreateLookAt(pos, target, up));
 }
예제 #9
0
 public static Vector3 Slerp(Vector3 v1, Vector3 v2, float amount)
 {
     return new Vector3(Vector.SmoothStep(v1, v2, amount));
 }
예제 #10
0
 public static Matrix CreateConstrainedBillboard(
     Vector3 objectPosition,
     Vector3 cameraPosition,
     Vector3 rotateAxis,
     Vector3? cameraForward,
     Vector3? objectForward)
 {
     return new Matrix(Matrix4x4.CreateConstrainedBillboard(objectPosition, cameraPosition, rotateAxis, cameraForward, objectForward));
 }
예제 #11
0
 public static Matrix CreateWorld(Vector3 pos, Vector3 forward, Vector3 up)
 {
     return new Matrix(Matrix4x4.CreateWorld(pos, forward, up));
 }
예제 #12
0
 public static Matrix CreateTranslation(Vector3 pos)
 {
     return new Matrix(Matrix4x4.CreateTranslation(pos));
 }
예제 #13
0
 public static Matrix CreateScale(Vector3 scale)
 {
     return new Matrix(Matrix4x4.CreateScale(scale));
 }
예제 #14
0
 public static Vector3 Lerp(Vector3 v1, Vector3 v2, float amount)
 {
     return new Vector3(Vector.Lerp(v1, v2, amount));
 }
예제 #15
0
 public static Quaterion FromAxisAngle(Vector3 axis, float angle)
 {
     return Quat.CreateFromAxisAngle(axis,angle);
 }
예제 #16
0
 public static Vector3 Reflect(Vector3 v, Vector3 n)
 {
     return Vector.Reflect(v, n);
 }
예제 #17
0
 public static Vector3 Barycentric(Vector3 v1, Vector3 v2, Vector3 v3, float a1,float a2)
 {
     return new Vector3(Vector.Barycentric(v1, v2, v3, a1,a2));
 }
예제 #18
0
 public static Vector3 Transform(Vector3 val, Matrix transform)
 {
     return new Vector3(Vector.Transform(val,transform));
 }
 public BoundingSphere(Vector3 center, float radius)
 {
     _sphere = new Sphere(center, radius);
 }