void Camera::Transform(const TRANSFORM *Trans) { MTransPoint(Location, Location, Trans); MTransDirection(Direction, Direction, Trans); MTransDirection(Up, Up, Trans); MTransDirection(Right, Right, Trans); }
void Transform_Camera(CAMERA *Camera, TRANSFORM *Trans) { MTransPoint(Camera->Location, Camera->Location, Trans); MTransDirection(Camera->Direction, Camera->Direction, Trans); MTransDirection(Camera->Up, Camera->Up, Trans); MTransDirection(Camera->Right, Camera->Right, Trans); }
static void Rotate_Plane (OBJECT *Object, VECTOR, TRANSFORM *Trans) { if (((PLANE *)Object)->Trans == NULL) { MTransDirection(((PLANE *)Object)->Normal_Vector, ((PLANE *)Object)->Normal_Vector, Trans); Compute_Plane_BBox(((PLANE *)Object)); } else { Transform_Plane (Object, Trans); } }
void Plane::Rotate(const VECTOR, const TRANSFORM *tr) { if(Trans == NULL) { MTransDirection(Normal_Vector, Normal_Vector, tr); Compute_BBox(); } else { Transform(tr); } }
void LightSource::Transform(const TRANSFORM *tr) { DBL len; MTransPoint(Center, Center, tr); MTransPoint(Points_At, Points_At, tr); MTransDirection(Axis1, Axis1, tr); MTransDirection(Axis2, Axis2, tr); MTransDirection(Direction, Direction, tr); /* Make sure direction has unit length. */ len = Direction.length(); if(len > EPSILON) Direction /= len; if(!children.empty()) Transform_Object(children[0], tr); if(Projected_Through_Object != NULL) Transform_Object(Projected_Through_Object, tr); }