public Vector3 GetRotation(SCN0CameraType type) { if (type == SCN0CameraType.Rotate) { return(Rot); } return(GetRotationMatrix(type).GetAngles()); }
public Matrix GetRotationMatrix(SCN0CameraType type) { if (type == SCN0CameraType.Rotate) { return(Matrix.RotationMatrix(Rot)); } return(Matrix.RotationMatrix(Aim.LookatAngles(Pos) * Maths._rad2degf) * Matrix.RotationAboutZ(Twist)); }
public Vector3 GetRotation(SCN0CameraType type) { if (type == SCN0CameraType.Rotate) { return(Rot); } else //Aim - calculate rotation facing the position { return(GetRotationMatrix(type).GetAngles()); } }
public Matrix GetRotationMatrix(SCN0CameraType type) { if (type == SCN0CameraType.Rotate) { return(Matrix.RotationMatrix(Rot)); } else //Aim - calculate rotation facing the position { return(Matrix.RotationMatrix(Aim.LookatAngles(Pos) * Maths._rad2degf) * Matrix.RotationAboutZ(Twist)); } }
public Vector3 GetRotate(int frame, SCN0CameraType type) { if (type == SCN0CameraType.Rotate) { return(Rot); } else //Aim - calculate rotation facing the position { Matrix m = Matrix.ReverseLookat(Aim, Pos, Twist); Vector3 a = m.GetAngles(); return(new Vector3(-a._x, -a._y, -a._z)); } }
public override bool OnInitialize() { //Read common header base.OnInitialize(); if (_name == "<null>") { return(false); } //Read header data _flags1 = (SCN0CameraFlags)(ushort)Data->_flags1; _flags2 = Data->_flags2; _type = (SCN0CameraType)((ushort)_flags2 & 1); _projType = (ProjectionType)(int)Data->_projectionType; //Read user data (_userEntries = new UserDataCollection()).Read(Data->UserData); return(false); }
public override bool OnInitialize() { base.OnInitialize(); _flags1 = (SCN0CameraFlags)(ushort)Data->_flags1; _flags2 = Data->_flags2; _type = (SCN0CameraType)((ushort)_flags2 & 1); _projType = (ProjectionType)(int)Data->_projType; for (int x = 0; x < 15; x++) { SetKeys(x, new KeyframeArray(FrameCount + 1)); } bint *values = (bint *)&Data->_position; if (Name != "<null>") { for (int i = 0; i < 15; i++) { //if (((int)_flags1 & (int)Ordered[i]) == 0) // SCN0Node.strings[(int)((&values[i] - Parent.Parent.WorkingUncompressed.Address + values[i]))] = "Camera" + Index + " Keys " + Ordered[i].ToString(); DecodeFrames(GetKeys(i), &values[i], (int)_flags1, (int)Ordered[i]); } } _posX._linear = true; _posY._linear = true; _posZ._linear = true; _aimX._linear = true; _aimY._linear = true; _aimZ._linear = true; (_userEntries = new UserDataCollection()).Read(Data->UserData); return(false); }
public override bool OnInitialize() { base.OnInitialize(); _flags1 = (SCN0CameraFlags)(ushort)Data->_flags1; _flags2 = Data->_flags2; _type = (SCN0CameraType)((ushort)_flags2 & 1); _projType = (ProjectionType)(int)Data->_projType; for (int x = 0; x < 15; x++) SetKeys(x, new KeyframeArray(FrameCount + 1)); bint* values = (bint*)&Data->_position; if (Name != "<null>") for (int i = 0; i < 15; i++) { //if (((int)_flags1 & (int)Ordered[i]) == 0) // SCN0Node.strings[(int)((&values[i] - Parent.Parent.WorkingUncompressed.Address + values[i]))] = "Camera" + Index + " Keys " + Ordered[i].ToString(); DecodeFrames(GetKeys(i), &values[i], (int)_flags1, (int)Ordered[i]); } _posX._linear = true; _posY._linear = true; _posZ._linear = true; _aimX._linear = true; _aimY._linear = true; _aimZ._linear = true; (_userEntries = new UserDataCollection()).Read(Data->UserData); return false; }
public Vector3 GetRotate(int frame, SCN0CameraType type) { if (type == SCN0CameraType.Rotate) return Rot; else //Aim - calculate rotation facing the position { Matrix m = Matrix.ReverseLookat(Aim, Pos, Twist); Vector3 a = m.GetAngles(); return new Vector3(-a._x, -a._y, -a._z); } }