void Camera::Transform()

{

// set the camera view matrix

transform[ 0] = right[Vector3::X];

transform[ 4] = right[Vector3::Y];

transform[ 8] = right[Vector3::Z];

transform[ 1] = up[Vector3::X];

transform[ 5] = up[Vector3::Y];

transform[ 9] = up[Vector3::Z];

transform[ 2] = view[Vector3::X];

transform[ 6] = view[Vector3::Y];

transform[10] = view[Vector3::Z];

transform[12] = -position.Dot(right);

transform[13] = -position.Dot(up);

transform[14] = -position.Dot(view);

//set world matrix also

world[ 0] = -right[Vector3::X];

world[ 1] = -right[Vector3::Y];

world[ 2] = -right[Vector3::Z];

world[ 4] = -up[Vector3::X];

world[ 5] = -up[Vector3::Y];

world[ 6] = -up[Vector3::Z];

world[ 8] = -view[Vector3::X];

world[ 9] = -view[Vector3::Y];

world[10] = -view[Vector3::Z];

world.Translate( position[Vector3::X], position[Vector3::Y], position[Vector3::Z] );

UpdateFrustrum();

}

Matrix4& Camera::GetTransform()

{

return transform;

}

void Camera::UpdateFrustrum()

{

// get frustrum in to world space

Matrix4 matViewProjection = GetTransform();

Matrix4 projViewMatrix = matViewProjection * projection;

frustum.SetUpFromProjection(projViewMatrix); // does plane extraction

}