double DistanceAtAngle(PointVector& points, TemplatePtr& T, double theta) { PointVector newpoints(points); RotateBy(newpoints, theta); return PathDistance(newpoints, T->Points); }
const BAffineTransform& BAffineTransform::RotateBy(const BPoint& center, double angle) { TranslateBy(-center.x, -center.y); RotateBy(angle); return TranslateBy(center.x, center.y); }
void RotateToZero(PointVector& points) { PointPtr c = Centroid(points); double theta = atan2(c->Y - points[0]->Y, c->X - points[0]->X); RotateBy(points, -theta); }
void TransformNode::Pitch(float angle) { RotateBy(angle, m_right); }
void Draw(BRect invalidate) { RotateBy(-M_PI / 5); TranslateBy(0, Bounds().Height() / 3); BStringView::Draw(invalidate); }
void TransformNode::Yaw(float angle) { RotateBy(angle, Vector3(0.0f, 1.0f, 0.0f)); }
void TransformNode::Roll(float angle) { RotateBy(angle, m_forward); }
void CSkyBox::Update(float fElapseTime) { RotateBy(0, m_fRotateSpeed * fElapseTime, 0); }
//---------------------------------------------------------------- /// Rotate By /// /// Rotate around the arbitary axis /// /// @param X-axis Component /// @param Y-axis Component /// @param Z-axis Component /// @param Angle in radians //---------------------------------------------------------------- void Transform::RotateBy(f32 inXAxis, f32 inYAxis, f32 inZAxis, f32 infAngleRads) { RotateBy(Vector3(inXAxis,inYAxis,inZAxis), infAngleRads); }
//---------------------------------------------------------------- /// Rotate Z By /// /// Rotate around the z-axis /// /// @param Angle to rotate in radians //---------------------------------------------------------------- void Transform::RotateZBy(f32 infAngleRads) { RotateBy(Vector3::k_unitPositiveZ, infAngleRads); }