bool SFRotation::equals(Field *field) { SFRotation *rotation = (SFRotation *)field; if (getX() == rotation->getX() && getY() == rotation->getY() && getZ() == rotation->getZ() && getAngle() == rotation->getAngle()) return true; else return false; }
void ViewpointNode::getFrame(float frame[3][3]) { SFRotation *orientation = getOrientationField(); // local x frame frame[0][0] = 1.0f; frame[0][1] = 0.0f; frame[0][2] = 0.0f; orientation->multi(frame[0]); // local 0 frame frame[1][0] = 0.0f; frame[1][1] = 1.0f; frame[1][2] = 0.0f; orientation->multi(frame[1]); // local 0 frame frame[2][0] = 0.0f; frame[2][1] = 0.0f; frame[2][2] = 1.0f; orientation->multi(frame[2]); }
void ViewpointNode::rotate(SFRotation rot) { float rotation[4]; rot.getValue(rotation); addOrientation(rotation); }
void MFRotation::set1Value(int index, float x, float y, float z, float angle) { SFRotation *rotation = (SFRotation *)getObject(index); if (rotation) rotation->setValue(x, y, z, angle); }
void MFRotation::set1Value(int index, float value[]) { SFRotation *rotation = (SFRotation *)getObject(index); if (rotation) rotation->setValue(value); }
void MFRotation::addValue(const char *value) { SFRotation *field = new SFRotation(); field->setValue(value); add(field); }