arrange of c lib
This commit is contained in:
@@ -47,11 +47,11 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
|
||||
private bool _isLookAtAvailable;
|
||||
internal MatrixKernel _lookAt;
|
||||
internal MatrixKernel _projection;
|
||||
internal MatrixKernel cameraAtt;
|
||||
internal MatrixKernel rotation;
|
||||
internal MatrixKernel rotationAtt;
|
||||
internal Matrix44 _lookAt;
|
||||
internal Matrix44 _projection;
|
||||
internal Matrix44 cameraAtt;
|
||||
internal Matrix44 rotation;
|
||||
internal Matrix44 rotationAtt;
|
||||
internal Radius _pitch;
|
||||
internal Radius _row;
|
||||
internal Radius _yaw;
|
||||
@@ -60,20 +60,20 @@ namespace StgSharp.Graphics
|
||||
|
||||
public Camera()
|
||||
{
|
||||
cameraAtt = MatrixKernel.Fp32Unit;
|
||||
cameraAtt = Matrix44.Unit;
|
||||
_target = Vec3.Zero;
|
||||
up = Vec3.Zero;
|
||||
_isLookAtAvailable = false;
|
||||
_lookAt = MatrixKernel.Fp32Unit;
|
||||
rotationAtt = MatrixKernel.Fp32Unit;
|
||||
_projection = new MatrixKernel(true);
|
||||
_lookAt = Matrix44.Unit;
|
||||
rotationAtt = Matrix44.Unit;
|
||||
_projection = new Matrix44();
|
||||
}
|
||||
|
||||
public Camera(Vec3 position, Vec3 target, Vec3 up)
|
||||
: this()
|
||||
{
|
||||
rotationAtt = MatrixKernel.Fp32Unit;
|
||||
cameraAtt = new MatrixKernel(true);
|
||||
rotationAtt = Matrix44.Unit;
|
||||
cameraAtt = new Matrix44();
|
||||
SetViewDirection(position, target, up);
|
||||
_pitch = Radius.Zero;
|
||||
_row = Radius.Zero;
|
||||
@@ -89,8 +89,8 @@ namespace StgSharp.Graphics
|
||||
if (_isLookAtAvailable) {
|
||||
return _lookAt;
|
||||
}
|
||||
Matrix44 move = MatrixKernel.Fp32Unit;
|
||||
move.colum3.vec -= cameraAtt.colum3;
|
||||
Matrix44 move = Matrix44.Unit;
|
||||
move.colum3.vec -= cameraAtt.colum3.vec;
|
||||
_lookAt = rotationAtt.Transpose * move;
|
||||
_isLookAtAvailable = true;
|
||||
return _lookAt;
|
||||
@@ -255,6 +255,7 @@ namespace StgSharp.Graphics
|
||||
|
||||
internal void InternalPitch()
|
||||
{
|
||||
/*
|
||||
_isLookAtAvailable = false;
|
||||
|
||||
Matrix32 partialCoord = new Matrix32(cameraAtt.colum1.vec, cameraAtt.colum2.vec);
|
||||
@@ -267,10 +268,12 @@ namespace StgSharp.Graphics
|
||||
rotationAtt.colum1.reg = partialCoord.colum0.reg;
|
||||
rotationAtt.colum2.reg = partialCoord.colum1.reg;
|
||||
rotationAtt.isTransposed = false;
|
||||
/**/
|
||||
}
|
||||
|
||||
internal void InternalRow()
|
||||
{
|
||||
/*
|
||||
_isLookAtAvailable = false;
|
||||
|
||||
Matrix32 partialCoord = new Matrix32(cameraAtt.colum0.vec, cameraAtt.colum1.vec);
|
||||
@@ -283,10 +286,12 @@ namespace StgSharp.Graphics
|
||||
rotationAtt.colum0.reg = partialCoord.colum0.reg;
|
||||
rotationAtt.colum1.reg = partialCoord.colum1.reg;
|
||||
rotationAtt.isTransposed = false;
|
||||
*/
|
||||
}
|
||||
|
||||
internal void InternalYaw()
|
||||
{
|
||||
/*
|
||||
_isLookAtAvailable = false;
|
||||
|
||||
Matrix32 partialCoord = new Matrix32(cameraAtt.colum0.vec, cameraAtt.colum2.vec);
|
||||
@@ -298,6 +303,7 @@ namespace StgSharp.Graphics
|
||||
rotationAtt.colum0.reg = partialCoord.colum0.reg;
|
||||
rotationAtt.colum2.reg = partialCoord.colum1.reg;
|
||||
rotationAtt.isTransposed = false;
|
||||
*/
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user