Thread: [Opal-commits] opal/src MeshShapeData.h,NONE,1.1 PlaneShapeData.h,NONE,1.1 RayShapeData.h,NONE,1.1 R
Status: Inactive
Brought to you by:
tylerstreeter
|
From: tylerstreeter <tyl...@us...> - 2005-02-22 04:28:22
|
Update of /cvsroot/opal/opal/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32471/src Modified Files: Rayr.h SConscript opal.h Added Files: MeshShapeData.h PlaneShapeData.h RayShapeData.h Log Message: added more ShapeData classes Index: opal.h =================================================================== RCS file: /cvsroot/opal/opal/src/opal.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** opal.h 22 Feb 2005 01:25:55 -0000 1.14 --- opal.h 22 Feb 2005 04:28:11 -0000 1.15 *************** *** 35,38 **** --- 35,41 ---- #include "SphereShapeData.h" #include "CapsuleShapeData.h" + #include "PlaneShapeData.h" + #include "RayShapeData.h" + #include "MeshShapeData.h" #include "Motor.h" #include "AttractorMotor.h" --- NEW FILE: PlaneShapeData.h --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * All rights reserved. * * Web: opal.sourceforge.net * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of EITHER: * * (1) The GNU Lesser General Public License as published by the Free * * Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. The text of the GNU Lesser * * General Public License is included with this library in the * * file license-LGPL.txt. * * (2) The BSD-style license that is included with this library in * * the file license-BSD.txt. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * license-LGPL.txt and license-BSD.txt for more details. * * * *************************************************************************/ #ifndef OPAL_PLANE_SHAPE_DATA_H #define OPAL_PLANE_SHAPE_DATA_H #include "Defines.h" #include "ShapeData.h" namespace opal { /// A data structure describing a plane Shape. class PlaneShapeData : public ShapeData { public: PlaneShapeData() : ShapeData() { type = PLANE_SHAPE; for (int i=0; i<4; ++i) { abcd[i] = 0; } } /// Copy constructor. PlaneShapeData(const PlaneShapeData& data) { (*this) = data; } virtual ~PlaneShapeData() { } /// Makes a deep copy. virtual void OPAL_CALL operator=(const PlaneShapeData& data) { type = data.type; offset = data.offset; material = data.material; for (int i=0; i<4; ++i) { abcd[i] = data.abcd[i]; } } /// Parameters used to define the plane equation: /// a*x + b*y + c*z = d. real abcd[4]; protected: private: }; } #endif Index: Rayr.h =================================================================== RCS file: /cvsroot/opal/opal/src/Rayr.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Rayr.h 20 Feb 2005 06:26:47 -0000 1.5 --- Rayr.h 22 Feb 2005 04:28:11 -0000 1.6 *************** *** 80,83 **** --- 80,88 ---- } + real getLength()const + { + return mDir.length(); + } + void setOrigin( const Point3r & p ) { --- NEW FILE: RayShapeData.h --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * All rights reserved. * * Web: opal.sourceforge.net * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of EITHER: * * (1) The GNU Lesser General Public License as published by the Free * * Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. The text of the GNU Lesser * * General Public License is included with this library in the * * file license-LGPL.txt. * * (2) The BSD-style license that is included with this library in * * the file license-BSD.txt. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * license-LGPL.txt and license-BSD.txt for more details. * * * *************************************************************************/ #ifndef OPAL_RAY_SHAPE_DATA_H #define OPAL_RAY_SHAPE_DATA_H #include "Defines.h" #include "ShapeData.h" namespace opal { /// A data structure describing a ray Shape. class RayShapeData : public ShapeData { public: RayShapeData() : ShapeData() { type = RAY_SHAPE; // "ray" is already initialized from its constructor. } /// Copy constructor. RayShapeData(const RayShapeData& data) { (*this) = data; } virtual ~RayShapeData() { } /// Makes a deep copy. virtual void OPAL_CALL operator=(const RayShapeData& data) { type = data.type; offset = data.offset; material = data.material; ray = data.ray; } /// The ray data. Rayr ray; protected: private: }; } #endif Index: SConscript =================================================================== RCS file: /cvsroot/opal/opal/src/SConscript,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SConscript 16 Feb 2005 21:22:40 -0000 1.8 --- SConscript 22 Feb 2005 04:28:11 -0000 1.9 *************** *** 7,10 **** --- 7,12 ---- Blueprint.h BlueprintManager.h + BoxShapeData.h + CapsuleShapeData.h Defines.h EventHandler.h *************** *** 12,28 **** --- 14,36 ---- Joint.h Matrix44r.h + MeshShapeData.h Motor.h opal.h OpalMath.h + PlaneShapeData.h Point3r.h Portability.h Quaternion.h Rayr.h + RayShapeData.h Sensor.h ServoMotor.h + ShapeData.h Simulator.h Singleton.h Solid.h + SolidData.h Space.h + SphereShapeData.h SpringMotor.h ThrusterMotor.h --- NEW FILE: MeshShapeData.h --- /************************************************************************* * * * Open Physics Abstraction Layer * * Copyright (C) 2004-2005 * * Alan Fischer ala...@gm... * * Andres Reinot an...@re... * * Tyler Streeter tyl...@gm... * * All rights reserved. * * Web: opal.sourceforge.net * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of EITHER: * * (1) The GNU Lesser General Public License as published by the Free * * Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. The text of the GNU Lesser * * General Public License is included with this library in the * * file license-LGPL.txt. * * (2) The BSD-style license that is included with this library in * * the file license-BSD.txt. * * * * This library is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * * license-LGPL.txt and license-BSD.txt for more details. * * * *************************************************************************/ #ifndef OPAL_MESH_SHAPE_DATA_H #define OPAL_MESH_SHAPE_DATA_H #include "Defines.h" #include "ShapeData.h" namespace opal { /// A data structure describing a mesh Shape. The data pointers /// for the vertex and face arrays must remain valid; no mesh data /// is stored anywhere within OPAL. It is critical that the size of /// the data type used in these arrays (i.e. OPAL real) matches the /// size of the data type expected by the underlying physics engine. class MeshShapeData : public ShapeData { public: MeshShapeData() : ShapeData() { type = MESH_SHAPE; vertexArray[0] = NULL; numVertices = 0; faceArray = NULL; numFaces = 0; } /// Copy constructor. MeshShapeData(const MeshShapeData& data) { (*this) = data; } virtual ~MeshShapeData() { } /// Makes a shallow copy, simply copying data pointers. virtual void OPAL_CALL operator=(const MeshShapeData& data) { type = data.type; offset = data.offset; material = data.material; vertexArray[0] = data.vertexArray[0]; numVertices = data.numVertices; faceArray = data.faceArray; numFaces = data.numFaces; } /// Pointer to a 2-dimensional array of vertices. For example, /// access the ith vertex like this: /// vertexArray[i][0] = 3.0; // x /// vertexArray[i][1] = 2.0; // y /// vertexArray[i][2] = 5.0; // z real* vertexArray[3]; /// The number of vertices in the mesh. int numVertices; /// Pointer to an array of indices into the vertex array. The size /// of this array = 3 * the number of faces since each face will /// need 3 different indices, one for each vertex. int* faceArray; /// The number of faces/triangles in the mesh. int numFaces; protected: private: }; } #endif |