- Timestamp:
- Sep 28, 2016, 8:41:02 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ReleaseNotes
r33 r87 3 3 - tool/FlairGCS: added rx rate display 4 4 - demos/SimpleFleet: new demo, 2 UAVs coordination 5 - srs/FlairSimulator: added fixed camera 5 6 6 7 ----------------------------------------------------------- -
trunk/lib/FlairSimulator/src/FixedCamera.cpp
r70 r87 35 35 namespace simulator { 36 36 37 FixedCamera::FixedCamera(std::string name,core::Vector3D position,float inRotateSpeed,float inZoomSpeed):VisualizationCamera(name) { 38 RotY = -90; 39 RotZ = 0; 37 FixedCamera::FixedCamera(std::string name,core::Vector3D position,core::Vector3D lookat,float inRotateSpeed,float inZoomSpeed):VisualizationCamera(name) { 40 38 Rotating = false; 41 39 rotateSpeed=inRotateSpeed; 42 40 zoomSpeed=inZoomSpeed; 41 42 camera->bindTargetAndRotation(true); 43 43 camera->setPosition(vector3df(ToIrrlichtCoordinates(position))); 44 camera->setTarget(vector3df(ToIrrlichtCoordinates(lookat))); 45 init=false; 46 rotation=camera->getRotation(); 47 printf("%f %f %f\n",rotation.X,rotation.Y,rotation.Z); 44 48 fov=camera->getFOV(); 45 49 } … … 57 61 void FixedCamera::animateNode(ISceneNode *node, u32 timeMs) { 58 62 ICameraSceneNode *camera = static_cast<ICameraSceneNode *>(node); 63 vector3df newRotation=rotation; 59 64 60 float nRotY = RotY; 61 float nRotZ = RotZ; 65 if(init==false) { 66 rotation=camera->getRotation(); 67 printf("%f %f %f\n",rotation.X,rotation.Y,rotation.Z); 68 init=true; 69 } 70 float nRotY = 0;//rotation.Y; 71 float nRotZ = rotation.Z; 62 72 63 73 if (LMouseKey == true) { … … 65 75 RotateStart = MousePos; 66 76 Rotating = true; 67 nRotY = RotY;68 nRotZ = RotZ;77 //nRotY = rotation.Y; 78 nRotZ = rotation.Z; 69 79 } else { 70 nRotY += (RotateStart.Y - MousePos.Y) * rotateSpeed;80 nRotY = (RotateStart.Y - MousePos.Y) * rotateSpeed; 71 81 nRotZ += (RotateStart.X - MousePos.X) * rotateSpeed; 72 nRotY = sat(nRotY); 82 newRotation.rotateXZBy(-nRotY); 83 //nRotY = sat(nRotY); 73 84 } 74 85 } else if (Rotating) { 75 RotY += (RotateStart.Y - MousePos.Y) * rotateSpeed;76 RotZ += (RotateStart.X - MousePos.X) * rotateSpeed;77 RotY = sat(RotY);78 nRotY = RotY;79 nRotZ = RotZ;86 //rotation.Y += (RotateStart.Y - MousePos.Y) * rotateSpeed; 87 //rotation.Z += (RotateStart.X - MousePos.X) * rotateSpeed; 88 //rotation.Y = sat(rotation.Y); 89 //nRotY = rotation.Y; 90 nRotZ = rotation.Z; 80 91 Rotating = false; 81 92 } … … 91 102 } 92 103 93 camera->setRotation(vector3df(0,nRotY,nRotZ)); 94 camera->bindTargetAndRotation(true); 104 105 106 //camera->setRotation(vector3df(rotation.X,-180-nRotY,nRotZ)); 107 //camera->setRotation(vector3df(rotation.X,nRotY,0)); 108 //camera->bindTargetAndRotation(true); 109 camera->setRotation(rotation); 110 //camera->setTarget(vector3df(ToIrrlichtCoordinates(core::Vector3D(0,0,-2)))); 111 //rotation=camera->getRotation(); 112 //printf("%f %f %f\n",rotation.X,rotation.Y,rotation.Z); 113 95 114 camera->setFOV(newFov); 96 115 } -
trunk/lib/FlairSimulator/src/FixedCamera.h
r70 r87 26 26 class FixedCamera : public VisualizationCamera { 27 27 public: 28 FixedCamera(std::string name,core::Vector3D position, float rotateSpeed = -500.0f, float zoomSpeed = .1f);28 FixedCamera(std::string name,core::Vector3D position,core::Vector3D lookat=core::Vector3D(0,0,0),float rotateSpeed = -500.0f, float zoomSpeed = .05f); 29 29 ~FixedCamera(); 30 30 … … 34 34 float sat(float value); 35 35 irr::core::position2df RotateStart; 36 irr::core::vector3df rotation; 36 37 bool Rotating; 37 38 float rotateSpeed; 38 39 float zoomSpeed; 39 float RotY, RotZ;40 40 float fov; 41 bool init; 41 42 }; 42 43 -
trunk/lib/FlairSimulator/src/Parser.cpp
r69 r87 19 19 #include "Simulator.h" 20 20 #include "GenericObject.h" 21 #include "FixedCamera.h" 21 22 #include <vector3d.h> 23 #include <Vector3D.h> 22 24 #include <IrrlichtDevice.h> 23 25 #include <IFileSystem.h> … … 188 190 getSceneVect(cur_node->children, (xmlChar *)"rotation"), 189 191 getSceneVect(cur_node->children, (xmlChar *)"scale", true)); 192 } else if (xmlStrEqual(cur_node->name, (xmlChar *)"camera")) { 193 FixedCamera* fixedCamera=new FixedCamera(std::string((char *)xmlGetProp(cur_node, (xmlChar *)"name")), 194 getMeshVector3D(cur_node->children, (xmlChar *)"position"), 195 getMeshVector3D(cur_node->children, (xmlChar *)"lookat")); 190 196 } 191 197 } … … 204 210 } 205 211 return vector3df(0, 0, 0); 212 } 213 214 Vector3D Parser::getMeshVector3D(xmlNode *mesh_node, xmlChar *param) { 215 xmlNode *cur_node = NULL; 216 for (cur_node = mesh_node; cur_node; cur_node = cur_node->next) { 217 if (xmlStrEqual(cur_node->name, param)) { 218 return Vector3D(atof((char *)xmlGetProp(cur_node, (xmlChar *)"x")), 219 atof((char *)xmlGetProp(cur_node, (xmlChar *)"y")), 220 atof((char *)xmlGetProp(cur_node, (xmlChar *)"z"))); 221 } 222 } 223 return Vector3D(0, 0, 0); 206 224 } 207 225 -
trunk/lib/FlairSimulator/src/Parser.h
r15 r87 23 23 24 24 namespace flair { 25 namespace core { 26 class Vector3D; 27 } 28 } 29 30 namespace flair { 25 31 namespace simulator { 26 32 class Parser : public Gui { … … 28 34 /*can create: 29 35 - cylinders: in y axis 36 - fixed cameras 30 37 31 38 */ … … 45 52 irr::core::vector3df getSceneVect(xmlNode *mesh_node, xmlChar *param, 46 53 bool isScale = false); 54 core::Vector3D getMeshVector3D(xmlNode *mesh_node, xmlChar *param); 47 55 }; 48 56 } -
trunk/tools/Dbt2csv/cmake_codeblocks.sh
r12 r87 1 1 DIR=build_$(uname -m) 2 3 ### IMPORTANT: We don't use standard cmake_codeblocks script since we don't compile in release mode due to optimization problem (-03) ### 2 4 3 5 #verifie l'existence du lien symbolique build … … 9 11 fi 10 12 if ! readlink build | grep -w $DIR >/dev/null; then 11 echo "Warnin k, build was pointing to another directory."13 echo "Warning, build was pointing to another directory." 12 14 fi 13 15 rm build … … 24 26 rm -f CMakeCache.txt 25 27 rm -rf CMakeFiles 26 cmake ../ -G "CodeBlocks - Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=${OECORE_CMAKE_HOST_TOOLCHAIN}28 ${OECORE_HOST_NATIVE_SYSROOT}/usr/bin/cmake ../ -G "CodeBlocks - Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=${OECORE_CMAKE_HOST_TOOLCHAIN}
Note:
See TracChangeset
for help on using the changeset viewer.