35 _targetNode(targetNode),
66 points.push_back(startPoint);
67 points.push_back(endPoint);
112 SLNode* rotationGizmosX =
new SLNode(
"Rotation Gizmos X");
116 SLNode* rotationGizmosY =
new SLNode(
"Rotation Gizmos Y");
120 SLNode* rotationGizmosZ =
new SLNode(
"Rotation Gizmos Z");
216 float actualHeight = (p1 - p2).length();
217 float targetHeight = 0.2f;
218 float scaleFactor = targetHeight / actualHeight;
361 float dist = FLT_MAX;
364 float minDistToOrigin = std::min(nodeToCameraDist * 0.1f, 1.0f);
374 float distCand = (axisPointCand - pickRayPoint).length();
376 if (distCand < dist && distCand < (
_gizmoScale * 0.1f) && t1 > minDistToOrigin)
380 axisPoint = axisPointCand;
393 float distCand = (axisPointCand - pickRayPoint).length();
395 if (distCand < dist && distCand < (
_gizmoScale * 0.1f) && t1 > minDistToOrigin)
399 axisPoint = axisPointCand;
412 float distCand = (axisPointCand - pickRayPoint).length();
414 if (distCand < dist && distCand < (
_gizmoScale * 0.1f) && t1 > minDistToOrigin)
418 axisPoint = axisPointCand;
457 float scaleFactor = newRadius / oldRadius;
511 float angle =
RAD2DEG * acos(rotationVec * rotationStartVec);
513 if (angle > FLT_EPSILON || angle < -FLT_EPSILON)
518 SLVec2f(intersectionPoint.
x, intersectionPoint.
y)))
540 float tCand = FLT_MAX;
617 cross.
cross(ray1Dir, ray2Dir);
622 if (den > FLT_EPSILON)
628 diffO.
y, ray2Dir.
y, cross.
y,
629 diffO.
z, ray2Dir.
z, cross.
z);
630 float det1 = m1.
det();
632 ray1P = ray1O + (ray1Dir * t1);
635 diffO.
y, ray1Dir.
y, cross.
y,
636 diffO.
z, ray1Dir.
z, cross.
z);
637 float det2 = m2.det();
639 ray2P = ray2O + (ray2Dir * t2);
658 cross.
cross(pickRayDir, axisRayDir);
661 if (den > FLT_EPSILON)
663 SLVec3f diffO = axisRayO - pickRayO;
667 diffO.
y, pickRayDir.
y, cross.
y,
668 diffO.
z, pickRayDir.
z, cross.
z);
674 axisPoint = axisRayO + (axisRayDir * t);
693 SLVec3f intersectPoint = rayO + rayDir * t;
694 SLVec3f discPointDist = intersectPoint - discO;
696 result = (discPointDist.
length() <= discR);
710 float den = planeN * rayDir;
711 if (den > FLT_EPSILON || den < -FLT_EPSILON)
714 t = (oDiff * planeN) / den;
732 float signedArea = 0.5f * (bc.
x * ac.
y - ac.
x * bc.
y);
733 bool result = (signedArea > 0.0f);
755 SLVec3f nodeDir = (nodePos - nodeTarget).normalize();
757 SLVec3f nodeRight = (up ^ nodeDir).normalize();
758 SLVec3f nodeUp = (nodeDir ^ nodeRight).normalize();
760 SLVec3f nodeTranslation = node->
om().translation();
764 nodeRight.
y, nodeUp.
y, nodeDir.
y, nodeTranslation.
y,
765 nodeRight.
z, nodeUp.
z, nodeDir.
z, nodeTranslation.
z,
766 0.0f, 0.0f, 0.0f, 1.0f);
#define SL_DB_OVERDRAW
Draw node over all other nodes.
#define SL_DB_HIDDEN
Flags an object as hidden.
SLMouseButton
Mouse button codes.
SLKey
Keyboard key codes enumeration.
SLMat3< SLfloat > SLMat3f
SLMat4< SLfloat > SLMat4f
SLVec2< SLfloat > SLVec2f
vector< SLVec3f > SLVVec3f
SLVec3< SLfloat > SLVec3f
SLVec4< SLfloat > SLVec4f
Active or visible camera node class.
Circle line mesh derived from SLPolyline.
Single arrow for coordinate axis.
SLDisk creates a disk mesh based on SLRevolver.
void set(SLuint bit, SLbool state)
Sets the specified bit to the passed state.
Encapsulation of an OpenGL shader program object.
static SLGLProgramGeneric * get(SLStdShaderProg id)
Get program reference for given id.
T det() const
det returns the determinant
SLVec3< T > translation() const
Defines a standard CG material with textures and a shader program.
SLNode represents a node in a hierarchical scene graph.
void addChild(SLNode *child)
void translation(const SLVec3f &pos, SLTransformSpace relativeTo=TS_parent)
void rotate(const SLQuat4f &rot, SLTransformSpace relativeTo=TS_object)
const SLMat4f & updateAndGetWM() const
void castsShadows(SLbool castsShadows)
SLVec3f translationWS() const
SLVec3f translationOS() const
void om(const SLMat4f &mat)
const SLMat4f & updateAndGetWMI() const
SLNode(const SLstring &name="Node")
Construct a new SLNode::SLNode object.
SLVec3f forwardWS() const
virtual SLAABBox & updateAABBRec(SLbool updateAlsoAABBinOS)
void translate(const SLVec3f &vec, SLTransformSpace relativeTo=TS_object)
SLPolyline creates a polyline object.
Ray class with ray and intersection properties.
SLVec3f origin
Vector to the origin of ray in WS.
SLVec3f dir
Direction vector of ray in WS.
SLVEventHandler & eventHandlers()
SceneView class represents a dynamic real time 3D view onto the scene.
void camera(SLCamera *camera)
void cross(const SLVec3 &a, const SLVec3 &b)
static const float RAD2DEG