00001
00002
00003 #include "main.h"
00004 #include "irrlichtDebugHelper.h"
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 static vector3df irrlichtDebugHelperArrowPosition;
00018
00019
00020 void irrlichtDebugHelperAddArrowX()
00021 {
00022 vector3df xPosition = irrlichtDebugHelperArrowPosition;
00023
00024 IAnimatedMesh* xArrowMesh;
00025 xArrowMesh = smgr->addArrowMesh("xArryow",
00026 50,
00027 50,
00028 100,
00029 70,
00030 3.0f,
00031 10.0f,
00032 SColor(255, 255, 0, 0),
00033 SColor(255, 255, 0, 0) );
00034 ISceneNode* xArrowNode;
00035 xArrowNode = smgr->addAnimatedMeshSceneNode( xArrowMesh );
00036 xArrowNode->setMaterialFlag( EMF_LIGHTING, false );
00037
00038 xArrowNode->setPosition( xPosition );
00039
00040 xArrowNode->setRotation( vector3df(0.0f, 0.0f, -90.0f) );
00041
00042 xPosition.X += 120.0f;
00043 xPosition.Y += 10.0f;
00044 smgr->addTextSceneNode( guienv->getBuiltInFont(),
00045 L"irr X",
00046 SColor(255,0,0,0),
00047 NULL,
00048 xPosition );
00049 }
00050
00051
00052 void irrlichtDebugHelperAddArrowY()
00053 {
00054 vector3df yPosition = irrlichtDebugHelperArrowPosition;
00055
00056 IAnimatedMesh* yArrowMesh;
00057 yArrowMesh = smgr->addArrowMesh("yArryow",
00058 50,
00059 50,
00060 100,
00061 70,
00062 3.0f,
00063 10.0f,
00064 SColor(255, 0, 255, 0),
00065 SColor(255, 0, 255, 0) );
00066 ISceneNode* yArrowNode;
00067 yArrowNode = smgr->addAnimatedMeshSceneNode( yArrowMesh );
00068 yArrowNode->setMaterialFlag( EMF_LIGHTING, false );
00069
00070 yArrowNode->setPosition( yPosition );
00071
00072 yArrowNode->setRotation( vector3df(0.0f, 0.0f, 0.0f) );
00073
00074 yPosition.Y += 120.0f;
00075 smgr->addTextSceneNode( guienv->getBuiltInFont(),
00076 L"irr Y",
00077 SColor(255,0,0,0),
00078 NULL,
00079 yPosition );
00080 }
00081
00082
00083 void irrlichtDebugHelperAddArrowZ()
00084 {
00085 vector3df zPosition = irrlichtDebugHelperArrowPosition;
00086
00087 IAnimatedMesh* zArrowMesh;
00088 zArrowMesh = smgr->addArrowMesh("zArryow",
00089 50,
00090 50,
00091 100,
00092 70,
00093 3.0f,
00094 10.0f,
00095 SColor(255, 0, 0, 255),
00096 SColor(255, 0, 0, 255) );
00097 ISceneNode* zArrowNode;
00098 zArrowNode = smgr->addAnimatedMeshSceneNode( zArrowMesh );
00099 zArrowNode->setMaterialFlag( EMF_LIGHTING, false );
00100
00101 zArrowNode->setPosition( zPosition );
00102
00103 zArrowNode->setRotation( vector3df(90.0f, 0.0f, 0.0f) );
00104
00105 zPosition.Z += 120.0f;
00106 smgr->addTextSceneNode( guienv->getBuiltInFont(),
00107 L"irr Z",
00108 SColor(255,0,0,0),
00109 NULL,
00110 zPosition );
00111 }
00112
00113
00114 void irrlichtDebugHelperAddArrows( vector3df position )
00115 {
00116 irrlichtDebugHelperArrowPosition = position;
00117
00118 irrlichtDebugHelperAddArrowX();
00119 irrlichtDebugHelperAddArrowY();
00120 irrlichtDebugHelperAddArrowZ();
00121 }