コード例 #1
0
void QToolAlign::renderManipulators()
{
	computeManipulatorSize();
	LLVector3 bbox_center = mBBox.getCenterAgent();
	LLVector3 bbox_scale = mBBox.getMaxLocal() - mBBox.getMinLocal();
	
	for (S32 axis = VX; axis <= VZ; axis++)
		for (F32 direction = -1.0; direction <= 1.0; direction += 2.0)
		{
			F32 size = mManipulatorSize;
			LLColor4 color = manipulator_color[axis];

			if ((axis == mHighlightedAxis) && (direction == mHighlightedDirection))
			{
				size *= 2.0;
				color *= 1.5;
			}

			S32 arrows = 1;
			if (mForce)
			{
				arrows = 2;
			}

			for (S32 i = 0; i < arrows; i++)
			{
				LLVector3 axis_vector = LLVector3(0,0,0);
				axis_vector.mV[axis] = direction * (bbox_scale.mV[axis] / 2.0 + i * (size/3.0));
			
				LLVector3 manipulator_center = 	bbox_center + axis_vector;

				LLQuaternion manipulator_rotation;
				manipulator_rotation.shortestArc(LLVector3(0,0,1), -1.0 * axis_vector);
				
				LLBBox manipulator_bbox = LLBBox(manipulator_center, manipulator_rotation,
												 LLVector3(), LLVector3());

				manipulator_bbox.addPointLocal(LLVector3(-1, -1, -0.75) * size * 0.5);
				manipulator_bbox.addPointLocal(LLVector3(1, 1, 0.75) * size * 0.5);
			
				gGL.color4fv(color.mV);
				// sadly, gCone doesn't use gGL like gBox does (presumably because its author smokes crack) so we
				// also set the raw GL color.  hopefully this won't screw-up later rendering.
				glColor4fv(color.mV);

				render_cone_bbox(manipulator_bbox);
			}
		}
}
コード例 #2
0
void QToolAlign::renderManipulators()
{
	computeManipulatorSize();
	LLVector3 bbox_center = mBBox.getCenterAgent();
	LLVector3 bbox_scale = mBBox.getMaxLocal() - mBBox.getMinLocal();
	
	for (S32 axis = VX; axis <= VZ; axis++)
		for (F32 direction = -1.0; direction <= 1.0; direction += 2.0)
		{
			F32 size = mManipulatorSize;
			LLColor4 color = manipulator_color[axis];

			if ((axis == mHighlightedAxis) && (direction == mHighlightedDirection))
			{
				size *= 2.0;
				color *= 1.5;
			}

			S32 arrows = 1;
			if (mForce)
			{
				arrows = 2;
			}

			for (S32 i = 0; i < arrows; i++)
			{
				LLVector3 axis_vector = LLVector3(0,0,0);
				axis_vector.mV[axis] = direction * (bbox_scale.mV[axis] / 2.0 + i * (size/3.0));
			
				LLVector3 manipulator_center = 	bbox_center + axis_vector;

				LLQuaternion manipulator_rotation;
				manipulator_rotation.shortestArc(LLVector3(0,0,1), -1.0 * axis_vector);
				
				LLBBox manipulator_bbox = LLBBox(manipulator_center, manipulator_rotation,
												 LLVector3(), LLVector3());

				manipulator_bbox.addPointLocal(LLVector3(-1, -1, -0.75) * size * 0.5);
				manipulator_bbox.addPointLocal(LLVector3(1, 1, 0.75) * size * 0.5);
			
				gGL.color4fv(color.mV);
				gGL.color4fv(color.mV);

				render_cone_bbox(manipulator_bbox);
			}
		}
}