From: Hedayat V. <hed...@ai...> - 2009-12-10 08:59:34
|
Hi, IMHO using a GenericPhysicsObject class for passing all parameters is not very nice. For example, it doesn't show that CRM function needs a matrix. I suggest defining a class for each type: e.g. GenericPhysicsMatrix for functions which need a matrix. Also, if engine specific classes inherit from generic classes (ODEMatrixClass inherited from both GenericPhysicsMatrix and dMatrix3, or inherited from GenericPhysicsMatrix and having a dMatrix3 member), you won't need to cast the object to the Generic class when passing object as a function parameter. BTW, use whatever you prefer. Thanks a lot, Hedayat On ۰۹/۱۲/۱۰ 12:04, a-...@us... wrote: > Revision: 118 > http://simspark.svn.sourceforge.net/simspark/?rev=118&view=rev > Author: a-held > Date: 2009-12-10 08:34:56 +0000 (Thu, 10 Dec 2009) > > Log Message: > ----------- > Searched and renamed all CCylinders, CappedCylinders and Capped Cylinders to Capsule > Implemented bridge pattern for CapsuleCollider > Provided bridge pattern for ConeCollider > Declared GenericPhysicsObject class that can be cast to in order to pass pointers > to engine-specific objects on to the abstract layer (like void*, but cleaner) > > Modified Paths: > -------------- > branches/multiphys/rcssserver3d/data/rsg/agent/hoap2.rsg > branches/multiphys/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg > branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot055.rsg > branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot056.rsg > branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/lowerarm.rsg > branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/soccerbot.rsg > branches/multiphys/rcssserver3d/data/rsg/agent/soccerbotcomp.rsg > branches/multiphys/rcssserver3d/doc/users/robots.tex > branches/multiphys/spark/data/ros/aibo.rsi > branches/multiphys/spark/data/ros/blockworld.ros > branches/multiphys/spark/data/rsg/boxspheres/simspark.rsg > branches/multiphys/spark/lib/kerosin/CMakeLists.txt > branches/multiphys/spark/lib/kerosin/kerosin.cpp > branches/multiphys/spark/lib/kerosin/kerosin.h > branches/multiphys/spark/lib/oxygen/CMakeLists.txt > branches/multiphys/spark/lib/oxygen/geometryserver/stdmeshimporter.cpp > branches/multiphys/spark/lib/oxygen/geometryserver/stdmeshimporter.h > branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp > branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.h > branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider_c.cpp > branches/multiphys/spark/lib/oxygen/physicsserver/collider.cpp > branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.h > branches/multiphys/spark/lib/oxygen/physicsserver/int/boxcolliderint.h > branches/multiphys/spark/lib/oxygen/physicsserver/int/physicsobjectint.h > branches/multiphys/spark/lib/oxygen/physicsserver/int/spherecolliderint.h > branches/multiphys/spark/lib/oxygen/physicsserver/int/worldint.h > branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecollider.cpp > branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsobject.cpp > branches/multiphys/spark/lib/oxygen/physicsserver/ode/odephysicsobject.h > branches/multiphys/spark/lib/oxygen/physicsserver/ode/oderigidbody.cpp > branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.cpp > branches/multiphys/spark/lib/oxygen/physicsserver/physicsobject.h > branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.cpp > branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody.h > branches/multiphys/spark/lib/oxygen/physicsserver/rigidbody_c.cpp > branches/multiphys/spark/plugin/rosimporter/roselements.cpp > branches/multiphys/spark/plugin/rosimporter/roselements.h > branches/multiphys/spark/plugin/rosimporter/rosimporter.cpp > branches/multiphys/spark/plugin/rosimporter/rosimporter.h > > Added Paths: > ----------- > branches/multiphys/rcssserver3d/data/rsg/agent/nao/capsule_appearance.rsg > branches/multiphys/rcssserver3d/data/rsg/agent/nao/capsule_physics.rsg > branches/multiphys/rcssserver3d/data/rsg/agent/nao/capsule_physics_nocollider.rsg > branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/box_with_hj_with_capsule.rsg > branches/multiphys/spark/data/rsg/boxspheres/capsule.rsg > branches/multiphys/spark/data/rsg/boxspheres/staticcapsule.rsg > branches/multiphys/spark/lib/kerosin/sceneserver/capsule.cpp > branches/multiphys/spark/lib/kerosin/sceneserver/capsule.h > branches/multiphys/spark/lib/kerosin/sceneserver/capsule_c.cpp > branches/multiphys/spark/lib/oxygen/physicsserver/conecollider.cpp > branches/multiphys/spark/lib/oxygen/physicsserver/genericphysicsobject.h > branches/multiphys/spark/lib/oxygen/physicsserver/int/capsulecolliderint.h > branches/multiphys/spark/lib/oxygen/physicsserver/int/conecolliderint.h > branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecapsulecollider.cpp > branches/multiphys/spark/lib/oxygen/physicsserver/ode/odecapsulecollider.h > branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconecollider.cpp > branches/multiphys/spark/lib/oxygen/physicsserver/ode/odeconecollider.h > > Removed Paths: > ------------- > branches/multiphys/rcssserver3d/data/rsg/agent/nao/ccylinder_appearance.rsg > branches/multiphys/rcssserver3d/data/rsg/agent/nao/ccylinder_physics.rsg > branches/multiphys/rcssserver3d/data/rsg/agent/nao/ccylinder_physics_nocollider.rsg > branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/box_with_hj_with_ccylinder.rsg > branches/multiphys/spark/data/rsg/boxspheres/ccylinder.rsg > branches/multiphys/spark/data/rsg/boxspheres/staticccylinder.rsg > branches/multiphys/spark/lib/kerosin/sceneserver/ccylinder.cpp > branches/multiphys/spark/lib/kerosin/sceneserver/ccylinder.h > branches/multiphys/spark/lib/kerosin/sceneserver/ccylinder_c.cpp > > Modified: branches/multiphys/rcssserver3d/data/rsg/agent/hoap2.rsg > =================================================================== > --- branches/multiphys/rcssserver3d/data/rsg/agent/hoap2.rsg 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/rcssserver3d/data/rsg/agent/hoap2.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -142,7 +142,7 @@ > (nd Transform > (setLocalPos $offsetLeftShoulderCylX $offsetLeftShoulderCylY $offsetLeftShoulderCylZ) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setMaterial matGrey) > (setParams $TorsoCylinderRadius $TorsoCylinderLength) > ) > @@ -151,7 +151,7 @@ > (nd Transform > (setLocalPos $offsetRightShoulderCylX $offsetRightShoulderCylY $offsetRightShoulderCylZ) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setMaterial matGrey) > (setParams $TorsoCylinderRadius $TorsoCylinderLength) > ) > @@ -373,7 +373,7 @@ > (nd Transform > (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setMaterial matGrey) > (setParams $ElbowRadius $ElbowLength) > ) > @@ -410,7 +410,7 @@ > (nd Transform > (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setMaterial matGrey) > (setParams $ElbowRadius $ElbowLength) > ) > > Added: branches/multiphys/rcssserver3d/data/rsg/agent/nao/capsule_appearance.rsg > =================================================================== > --- branches/multiphys/rcssserver3d/data/rsg/agent/nao/capsule_appearance.rsg (rev 0) > +++ branches/multiphys/rcssserver3d/data/rsg/agent/nao/capsule_appearance.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -0,0 +1,11 @@ > +; -*- mode: lisp; -*- > + > +(RSG 0 1) > +( > + (templ $radius $length $material) > + > + (nd Capsule > + (setParams $radius $length) > + (setMaterial $material) > + ) > +) > > Added: branches/multiphys/rcssserver3d/data/rsg/agent/nao/capsule_physics.rsg > =================================================================== > --- branches/multiphys/rcssserver3d/data/rsg/agent/nao/capsule_physics.rsg (rev 0) > +++ branches/multiphys/rcssserver3d/data/rsg/agent/nao/capsule_physics.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -0,0 +1,19 @@ > +; -*- mode: lisp; -*- > + > +(RSG 0 1) > +( > + (templ $radius $length $totalMass) > + > + (nd RigidBody > + (setName capsuleBody) > + (setCapsuleTotal $totalMass $radius $length) > + > + (importScene rsg/agent/nao/dragcontroller.rsg) > + ) > + > + (nd CapsuleCollider > + (setParams $radius $length) > + > + (importScene rsg/agent/nao/contactjointhandler.rsg) > + ) > + ) > > Added: branches/multiphys/rcssserver3d/data/rsg/agent/nao/capsule_physics_nocollider.rsg > =================================================================== > --- branches/multiphys/rcssserver3d/data/rsg/agent/nao/capsule_physics_nocollider.rsg (rev 0) > +++ branches/multiphys/rcssserver3d/data/rsg/agent/nao/capsule_physics_nocollider.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -0,0 +1,13 @@ > +; -*- mode: lisp; -*- > + > +(RSG 0 1) > +( > + (templ $radius $length $totalMass) > + > + (nd RigidBody > + (setName capsuleBody) > + (setCapsuleTotal $totalMass $radius) > + > + (importScene rsg/agent/nao/dragcontroller.rsg) > + ) > +) > > Deleted: branches/multiphys/rcssserver3d/data/rsg/agent/nao/ccylinder_appearance.rsg > =================================================================== > --- branches/multiphys/rcssserver3d/data/rsg/agent/nao/ccylinder_appearance.rsg 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/rcssserver3d/data/rsg/agent/nao/ccylinder_appearance.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -1,11 +0,0 @@ > -; -*- mode: lisp; -*- > - > -(RSG 0 1) > -( > - (templ $radius $length $material) > - > - (nd CCylinder > - (setParams $radius $length) > - (setMaterial $material) > - ) > -) > > Deleted: branches/multiphys/rcssserver3d/data/rsg/agent/nao/ccylinder_physics.rsg > =================================================================== > --- branches/multiphys/rcssserver3d/data/rsg/agent/nao/ccylinder_physics.rsg 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/rcssserver3d/data/rsg/agent/nao/ccylinder_physics.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -1,19 +0,0 @@ > -; -*- mode: lisp; -*- > - > -(RSG 0 1) > -( > - (templ $radius $length $totalMass) > - > - (nd RigidBody > - (setName ccylinderBody) > - (setCappedCylinderTotal $totalMass $radius $length) > - > - (importScene rsg/agent/nao/dragcontroller.rsg) > - ) > - > - (nd CCylinderCollider > - (setParams $radius $length) > - > - (importScene rsg/agent/nao/contactjointhandler.rsg) > - ) > - ) > > Deleted: branches/multiphys/rcssserver3d/data/rsg/agent/nao/ccylinder_physics_nocollider.rsg > =================================================================== > --- branches/multiphys/rcssserver3d/data/rsg/agent/nao/ccylinder_physics_nocollider.rsg 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/rcssserver3d/data/rsg/agent/nao/ccylinder_physics_nocollider.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -1,13 +0,0 @@ > -; -*- mode: lisp; -*- > - > -(RSG 0 1) > -( > - (templ $radius $length $totalMass) > - > - (nd RigidBody > - (setName ccylinderBody) > - (setCappedCylinderTotal $totalMass $radius) > - > - (importScene rsg/agent/nao/dragcontroller.rsg) > - ) > -) > > Modified: branches/multiphys/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg > =================================================================== > --- branches/multiphys/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/rcssserver3d/data/rsg/agent/nao/naoneckhead.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -43,12 +43,12 @@ > (setName neck) > (setLocalPos $Neck_X $Neck_Y $Neck_Z) > > - (importScene rsg/agent/nao/ccylinder_appearance.rsg $Neck_Radius $Neck_Length matDarkGrey) > - (importScene rsg/agent/nao/ccylinder_physics.rsg $Neck_Radius $Neck_Length $Neck_Mass) > + (importScene rsg/agent/nao/capsule_appearance.rsg $Neck_Radius $Neck_Length matDarkGrey) > + (importScene rsg/agent/nao/capsule_physics.rsg $Neck_Radius $Neck_Length $Neck_Mass) > > (importScene rsg/agent/nao/hingejoint.rsg > hj1 he1 > - ../ccylinderBody ../../body/boxBody > + ../capsuleBody ../../body/boxBody > 0 0 0 > 0 0 1 > $he1_min $he1_max) > @@ -80,7 +80,7 @@ > > (importScene rsg/agent/nao/hingejoint.rsg > hj2 he2 > - ../sphereBody ../../neck/ccylinderBody > + ../sphereBody ../../neck/capsuleBody > ;../boxBody ../../body/boxBody > 0 0 -0.005 > 1 0 0 > > Modified: branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot055.rsg > =================================================================== > --- branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot055.rsg 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot055.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -168,7 +168,7 @@ > (nd Transform > (setLocalPos $offsetLeftShoulderCylX $offsetLeftShoulderCylY $offsetLeftShoulderCylZ) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setName leftshoulderpin) > (setMaterial matDarkGrey) > (setParams $TorsoCylinderRadius $TorsoCylinderLength) > @@ -178,7 +178,7 @@ > (nd Transform > (setLocalPos $offsetRightShoulderCylX $offsetRightShoulderCylY $offsetRightShoulderCylZ) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setName rightshoulderpin) > (setMaterial matDarkGrey) > (setParams $TorsoCylinderRadius $TorsoCylinderLength) > @@ -336,7 +336,7 @@ > (nd Transform > (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setMaterial matGrey) > (setParams $ElbowRadius $ElbowLength) > ) > @@ -374,7 +374,7 @@ > (nd Transform > (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setMaterial matGrey) > (setParams $ElbowRadius $ElbowLength) > ) > > Modified: branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot056.rsg > =================================================================== > --- branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot056.rsg 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot056.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -204,7 +204,7 @@ > (nd Transform > (setLocalPos $offsetLeftShoulderCylX $offsetLeftShoulderCylY $offsetLeftShoulderCylZ) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setName leftshoulderpin) > (setMaterial matDarkGrey) > (setParams $TorsoCylinderRadius $TorsoCylinderLength) > @@ -214,7 +214,7 @@ > (nd Transform > (setLocalPos $offsetRightShoulderCylX $offsetRightShoulderCylY $offsetRightShoulderCylZ) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setName rightshoulderpin) > (setMaterial matDarkGrey) > (setParams $TorsoCylinderRadius $TorsoCylinderLength) > @@ -409,7 +409,7 @@ > (nd Transform > (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setMaterial matGrey) > (setParams $ElbowRadius $ElbowLength) > ) > @@ -455,7 +455,7 @@ > (nd Transform > (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setMaterial matGrey) > (setParams $ElbowRadius $ElbowLength) > ) > @@ -771,7 +771,7 @@ > (nd Transform > (setLocalPos 0 0 (eval (eval $ThighHeight * -0.5) - 0.025)) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setMaterial matRed) > (setParams 0.1 (eval $ThighLength - 0.2)) > ) > @@ -812,7 +812,7 @@ > (nd Transform > (setLocalPos 0 0 (eval (eval $ThighHeight * -0.5) - 0.025)) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setMaterial matRed) > (setParams 0.1 (eval $ThighLength - 0.2)) > ) > > Added: branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/box_with_hj_with_capsule.rsg > =================================================================== > --- branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/box_with_hj_with_capsule.rsg (rev 0) > +++ branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/box_with_hj_with_capsule.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -0,0 +1,37 @@ > +;; -*- mode: lisp; -*- > + > +(RSG 0 1) > +( > + (templ $name $perceptorName $effectorName $attach > + $x $y $z > + $lenX $lenY $lenZ > + $anchorX $anchorY $anchorZ > + $axisX $axisY $axisZ $minDeg $maxDeg > + $totalMass $material $ElbowRadius $ElbowLen) > + > + (nd Transform > + (setName $name) > + (setLocalPos $x $y $z) > + (importScene rsg/agent/soccerbot058/box.rsg > + $lenX $lenY $lenZ > + $totalMass $material) > + > + ;; install hinge joint > + (importScene rsg/agent/nao/hingejoint.rsg > + $perceptorName $effectorName > + ../boxBody $attach > + $anchorX $anchorY $anchorZ > + $axisX $axisY $axisZ > + $minDeg $maxDeg) > + > + ;; static cylinder for the elbow > + (nd Transform > + (setLocalPos $anchorX $anchorY $anchorZ) > + (setLocalRotation 0 90 0) > + (nd Capsule > + (setMaterial matGrey) > + (setParams $ElbowRadius $ElbowLen) > + ) > + ) > + ) > + ) > > Deleted: branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/box_with_hj_with_ccylinder.rsg > =================================================================== > --- branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/box_with_hj_with_ccylinder.rsg 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/box_with_hj_with_ccylinder.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -1,37 +0,0 @@ > -;; -*- mode: lisp; -*- > - > -(RSG 0 1) > -( > - (templ $name $perceptorName $effectorName $attach > - $x $y $z > - $lenX $lenY $lenZ > - $anchorX $anchorY $anchorZ > - $axisX $axisY $axisZ $minDeg $maxDeg > - $totalMass $material $ElbowRadius $ElbowLen) > - > - (nd Transform > - (setName $name) > - (setLocalPos $x $y $z) > - (importScene rsg/agent/soccerbot058/box.rsg > - $lenX $lenY $lenZ > - $totalMass $material) > - > - ;; install hinge joint > - (importScene rsg/agent/nao/hingejoint.rsg > - $perceptorName $effectorName > - ../boxBody $attach > - $anchorX $anchorY $anchorZ > - $axisX $axisY $axisZ > - $minDeg $maxDeg) > - > - ;; static cylinder for the elbow > - (nd Transform > - (setLocalPos $anchorX $anchorY $anchorZ) > - (setLocalRotation 0 90 0) > - (nd CCylinder > - (setMaterial matGrey) > - (setParams $ElbowRadius $ElbowLen) > - ) > - ) > - ) > - ) > > Modified: branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/lowerarm.rsg > =================================================================== > --- branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/lowerarm.rsg 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/lowerarm.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -38,7 +38,7 @@ > (nd Transform > (setLocalPos $anchorX $anchorY $anchorZ) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setMaterial matGrey) > (setParams $ElbowRadius $ElbowLen) > ) > > Modified: branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/soccerbot.rsg > =================================================================== > --- branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/soccerbot.rsg 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/rcssserver3d/data/rsg/agent/soccerbot058/soccerbot.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -216,7 +216,7 @@ > $offsetLeftShoulderCylY > $offsetLeftShoulderCylZ) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setName leftshoulderpin) > (setMaterial matDarkGrey) > (setParams $TorsoCylinderRadius $TorsoCylinderLength) > @@ -228,7 +228,7 @@ > $offsetRightShoulderCylY > $offsetRightShoulderCylZ) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setName rightshoulderpin) > (setMaterial matDarkGrey) > (setParams $TorsoCylinderRadius $TorsoCylinderLength) > @@ -434,7 +434,7 @@ > - (eval $ShankHeight / 2.0) > - (eval 0.05 * $scale))) > (def $ShankAnchorZ (eval $ShankHeight * 0.5)) > - (importScene rsg/agent/soccerbot058/box_with_hj_with_ccylinder.rsg > + (importScene rsg/agent/soccerbot058/box_with_hj_with_capsule.rsg > leftshank llj4 lle4 ../../leftthigh/boxBody > $LeftShankPosX $LeftShankPosY $LeftShankPosZ > $ShankLength $ShankWidth $ShankHeight > @@ -447,7 +447,7 @@ > (def $RightShankPosX $RightThighPosX) > (def $RightShankPosY $RightThighPosY) > (def $RightShankPosZ $LeftShankPosZ) > - (importScene rsg/agent/soccerbot058/box_with_hj_with_ccylinder.rsg > + (importScene rsg/agent/soccerbot058/box_with_hj_with_capsule.rsg > rightshank rlj4 rle4 ../../rightthigh/boxBody > $RightShankPosX $RightShankPosY $RightShankPosZ > $ShankLength $ShankWidth $ShankHeight > > Modified: branches/multiphys/rcssserver3d/data/rsg/agent/soccerbotcomp.rsg > =================================================================== > --- branches/multiphys/rcssserver3d/data/rsg/agent/soccerbotcomp.rsg 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/rcssserver3d/data/rsg/agent/soccerbotcomp.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -203,7 +203,7 @@ > (nd Transform > (setLocalPos $offsetLeftShoulderCylX $offsetLeftShoulderCylY $offsetLeftShoulderCylZ) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setName leftshoulderpin) > (setMaterial matDarkGrey) > (setParams $TorsoCylinderRadius $TorsoCylinderLength) > @@ -213,7 +213,7 @@ > (nd Transform > (setLocalPos $offsetRightShoulderCylX $offsetRightShoulderCylY $offsetRightShoulderCylZ) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setName rightshoulderpin) > (setMaterial matDarkGrey) > (setParams $TorsoCylinderRadius $TorsoCylinderLength) > @@ -369,7 +369,7 @@ > (nd Transform > (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setMaterial matGrey) > (setParams $ElbowRadius $ElbowLength) > ) > @@ -415,7 +415,7 @@ > (nd Transform > (setLocalPos 0 0 (eval -1 * (eval (eval $UpperarmHeight / 2.0) + (eval $ElbowRadius / 2.0)))) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setMaterial matGrey) > (setParams $ElbowRadius $ElbowLength) > ) > @@ -621,7 +621,7 @@ > (nd Transform > (setLocalPos 0 0 (eval (eval $ThighHeight * -0.5) - 0.025)) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setMaterial matRed) > (setParams 0.1 (eval $ThighLength - 0.2)) > ) > @@ -662,7 +662,7 @@ > (nd Transform > (setLocalPos 0 0 (eval (eval $ThighHeight * -0.5) - 0.025)) > (setLocalRotation 0 90 0) > - (nd CCylinder > + (nd Capsule > (setMaterial matRed) > (setParams 0.1 (eval $ThighLength - 0.2)) > ) > > Modified: branches/multiphys/rcssserver3d/doc/users/robots.tex > =================================================================== > --- branches/multiphys/rcssserver3d/doc/users/robots.tex 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/rcssserver3d/doc/users/robots.tex 2009-12-10 08:34:56 UTC (rev 118) > @@ -237,11 +237,11 @@ > box\_physics\_with\_handler.rsg& Not only do the job as file > “box\_physics.rsg”, but also install a touchperceptorhandler under > the BoxCollider Node. \\ > - ccylinder\_appearance.rsg& Install a capped cylinder which is > + capsule\_appearance.rsg& Install a capsule which is > for the GL render. \\ > - ccylinder\_physics.rsg& Install a capped cylinder that has > + capsule\_physics.rsg& Install a capsule that has > physics effect(ODE related) \\ > - ccylinder\_physics\_nocollider.rsg& Install a capped cylinder that > + capsule\_physics\_nocollider.rsg& Install a capsule that > only has dynamics effect (mass, linear velocity, etc). But it can > never collide to the others. \\ > contactjointhandler.rsg& Install a contactjointhandler to > > Modified: branches/multiphys/spark/data/ros/aibo.rsi > =================================================================== > --- branches/multiphys/spark/data/ros/aibo.rsi 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/spark/data/ros/aibo.rsi 2009-12-10 08:34:56 UTC (rev 118) > @@ -12184,13 +12184,13 @@ > </PhysicalAttributes> > </SimpleBox> > <!-- > -<SimpleCappedCylinder name="larm3Capped" radius="0.016" height="0.03"> > +<SimpleCapsule name="larm3Capped" radius="0.016" height="0.03"> > <Translation x="-0.003" y="-0.028" z="0.0"/> > <Rotation x="-90.0" y="0.0" z="-25.0"/> > <PhysicalAttributes> > <Mass value="0.05"/> > </PhysicalAttributes> > -</SimpleCappedCylinder> > +</SimpleCapsule> > --> > </PhysicalRepresentation> > </ComplexShape> > @@ -15442,13 +15442,13 @@ > </PhysicalAttributes> > </SimpleBox> > <!-- > -<SimpleCappedCylinder name="rarm3Capped" radius="0.016" height="0.03"> > +<SimpleCapsule name="rarm3Capped" radius="0.016" height="0.03"> > <Translation x="-0.003" y="-0.028" z="0.0"/> > <Rotation x="-90.0" y="0.0" z="-25.0"/> > <PhysicalAttributes> > <Mass value="0.05"/> > </PhysicalAttributes> > -</SimpleCappedCylinder> > +</SimpleCapsule> > --> > </PhysicalRepresentation> > </ComplexShape> > @@ -24870,13 +24870,13 @@ > </Polygon> > </GraphicalRepresentation> > <PhysicalRepresentation> > -<SimpleCappedCylinder name="headCCylinder" radius="0.026" height="0.075"> > +<SimpleCapsule name="headCapsule" radius="0.026" height="0.075"> > <Translation x="-0.023" y="0.005" z="0.0"/> > <Rotation x="0.0" y="90.0" z="20.0"/> > <PhysicalAttributes> > <Mass value="0.25"/> > </PhysicalAttributes> > -</SimpleCappedCylinder> > +</SimpleCapsule> > <SimpleSphere name="headSphere" radius="0.032"> > <Translation x="0.012" y="0.012" z="0.0"/> > <PhysicalAttributes> > @@ -25191,13 +25191,13 @@ > </Polygon> > </GraphicalRepresentation> > <PhysicalRepresentation> > -<SimpleCappedCylinder name="neckCCylinder" radius="0.013" height="0.034"> > +<SimpleCapsule name="neckCapsule" radius="0.013" height="0.034"> > <Translation x="0.0" y="0.038" z="0.0"/> > <Rotation x="90.0" y="0.0" z="0.0"/> > <PhysicalAttributes> > <Mass value="0.05"/> > </PhysicalAttributes> > -</SimpleCappedCylinder> > +</SimpleCapsule> > <SimpleSphere name="neckSphere" radius="0.032"> > <Translation x="0.0" y="0.08" z="0.0"/> > <PhysicalAttributes> > @@ -27630,13 +27630,13 @@ > <Mass value="1.0"/> > </PhysicalAttributes> > </SimpleSphere> > -<SimpleCappedCylinder name="bodyCCylinder" radius="0.04" height="0.05"> > +<SimpleCapsule name="bodyCapsule" radius="0.04" height="0.05"> > <Translation x="0.0" y="-0.005" z="0.0"/> > <Rotation x="0.0" y="90.0" z="0.0"/> > <PhysicalAttributes> > <Mass value="2.5"/> > </PhysicalAttributes> > -</SimpleCappedCylinder> > +</SimpleCapsule> > <SimpleSphere name="bodySphere2" radius="0.055"> > <Translation x="0.06" y="0.004" z="0.0"/> > <PhysicalAttributes> > @@ -27764,4 +27764,4 @@ > </Elements> > </Movable> > </Macro> > -</RoSiIncludeFile> > \ No newline at end of file > +</RoSiIncludeFile> > > Modified: branches/multiphys/spark/data/ros/blockworld.ros > =================================================================== > --- branches/multiphys/spark/data/ros/blockworld.ros 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/spark/data/ros/blockworld.ros 2009-12-10 08:34:56 UTC (rev 118) > @@ -273,16 +273,16 @@ > </Box> > </Elements> > </Movable> > -<Movable name="cappedcylinder"> > +<Movable name="capsule"> > <Elements> > -<CappedCylinder name="CappedCylinder" radius="0.05" height="0.15"> > +<Capsule name="Capsule" radius="0.05" height="0.15"> > <Translation x="0.3" y="-0.5" z="0.5"/> > <Rotation x="0" y="80" z="0"/> > <Appearance ref="green"/> > <PhysicalAttributes> > <Mass value="1"/> > </PhysicalAttributes> > -</CappedCylinder> > +</Capsule> > </Elements> > </Movable> > </Elements> > > Added: branches/multiphys/spark/data/rsg/boxspheres/capsule.rsg > =================================================================== > --- branches/multiphys/spark/data/rsg/boxspheres/capsule.rsg (rev 0) > +++ branches/multiphys/spark/data/rsg/boxspheres/capsule.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -0,0 +1,35 @@ > +; -*- mode: lisp; -*- > + > +(RSG 0 1) > +( > + (templ $radius $length $totalMass $material) > + > + (nd Capsule > + (setParams $radius $length) > + (setMaterial $material) > + ) > + > + (nd RigidBody > + (setName capsuleBody) > + ;(setCapsuleTotal $totalMass $radius $length) > + (setCapsule $totalMass $radius $length) > + ) > + > + (nd CapsuleCollider > + (setParams $radius $length) > + (nd ContactJointHandler > + (setContactBounceMode false) > + > + (setContactSlipMode true) > + (setContactSlip 0.1 0.1) > + > + (setContactSoftERPMode true) > + (setContactSoftERP 0.2) > + > + (setContactSoftCFM true) > + (setContactSoftCFM 0.01) > + ) > + ) > + ) > + > + > > Deleted: branches/multiphys/spark/data/rsg/boxspheres/ccylinder.rsg > =================================================================== > --- branches/multiphys/spark/data/rsg/boxspheres/ccylinder.rsg 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/spark/data/rsg/boxspheres/ccylinder.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -1,35 +0,0 @@ > -; -*- mode: lisp; -*- > - > -(RSG 0 1) > -( > - (templ $radius $length $totalMass $material) > - > - (nd CCylinder > - (setParams $radius $length) > - (setMaterial $material) > - ) > - > - (nd RigidBody > - (setName ccylinderBody) > - ;(setCappedCylinderTotal $totalMass $radius $length) > - (setCappedCylinder $totalMass $radius $length) > - ) > - > - (nd CCylinderCollider > - (setParams $radius $length) > - (nd ContactJointHandler > - (setContactBounceMode false) > - > - (setContactSlipMode true) > - (setContactSlip 0.1 0.1) > - > - (setContactSoftERPMode true) > - (setContactSoftERP 0.2) > - > - (setContactSoftCFM true) > - (setContactSoftCFM 0.01) > - ) > - ) > - ) > - > - > > Modified: branches/multiphys/spark/data/rsg/boxspheres/simspark.rsg > =================================================================== > --- branches/multiphys/spark/data/rsg/boxspheres/simspark.rsg 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/spark/data/rsg/boxspheres/simspark.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -35,15 +35,15 @@ > ) > ) > > -; add capped cylinder > +; add capsule > (nd Transform > (setLocalPos -4 0 20) > - (importScene rsg/boxspheres/ccylinder.rsg 1 3 2 matBlue) > + (importScene rsg/boxspheres/capsule.rsg 1 3 2 matBlue) > ) > > (nd Transform > (setLocalPos -6 3 20) > - (importScene rsg/boxspheres/ccylinder.rsg 1 10 2 matWhite) > + (importScene rsg/boxspheres/capsule.rsg 1 10 2 matWhite) > ) > > ; add two layer of spheres > @@ -58,4 +58,4 @@ > (importScene rsg/boxspheres/layer.rsg 1 1) > ) > > -) > \ No newline at end of file > +) > > Added: branches/multiphys/spark/data/rsg/boxspheres/staticcapsule.rsg > =================================================================== > --- branches/multiphys/spark/data/rsg/boxspheres/staticcapsule.rsg (rev 0) > +++ branches/multiphys/spark/data/rsg/boxspheres/staticcapsule.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -0,0 +1,17 @@ > +; -*- mode: lisp; -*- > + > +(RSG 0 1) > +( > + (templ $radius $length $density $material) > + > + (nd Capsule > + (setParams $radius $length) > + (setMaterial $material) > + ) > + > + (nd CapsuleCollider > + (setParams $radius $length) > + ) > + ) > + > + > > Deleted: branches/multiphys/spark/data/rsg/boxspheres/staticccylinder.rsg > =================================================================== > --- branches/multiphys/spark/data/rsg/boxspheres/staticccylinder.rsg 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/spark/data/rsg/boxspheres/staticccylinder.rsg 2009-12-10 08:34:56 UTC (rev 118) > @@ -1,17 +0,0 @@ > -; -*- mode: lisp; -*- > - > -(RSG 0 1) > -( > - (templ $radius $length $density $material) > - > - (nd CCylinder > - (setParams $radius $length) > - (setMaterial $material) > - ) > - > - (nd CCylinderCollider > - (setParams $radius $length) > - ) > - ) > - > - > > Modified: branches/multiphys/spark/lib/kerosin/CMakeLists.txt > =================================================================== > --- branches/multiphys/spark/lib/kerosin/CMakeLists.txt 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/spark/lib/kerosin/CMakeLists.txt 2009-12-10 08:34:56 UTC (rev 118) > @@ -25,7 +25,7 @@ > sceneserver/light.h > sceneserver/sphere.h > sceneserver/box.h > - sceneserver/ccylinder.h > + sceneserver/capsule.h > sceneserver/cylinder.h > sceneserver/staticmesh.h > soundserver/soundeffect.h > @@ -90,8 +90,8 @@ > sceneserver/box_c.cpp > sceneserver/sphere.cpp > sceneserver/sphere_c.cpp > - sceneserver/ccylinder.cpp > - sceneserver/ccylinder_c.cpp > + sceneserver/capsule.cpp > + sceneserver/capsule_c.cpp > sceneserver/cylinder.cpp > sceneserver/cylinder_c.cpp > sceneserver/staticmesh.cpp > > Modified: branches/multiphys/spark/lib/kerosin/kerosin.cpp > =================================================================== > --- branches/multiphys/spark/lib/kerosin/kerosin.cpp 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/spark/lib/kerosin/kerosin.cpp 2009-12-10 08:34:56 UTC (rev 118) > @@ -58,7 +58,7 @@ > zg.GetCore()->RegisterClassObject(new CLASS(Light), "kerosin/"); > zg.GetCore()->RegisterClassObject(new CLASS(StaticMesh), "kerosin/"); > zg.GetCore()->RegisterClassObject(new CLASS(Box), "kerosin/"); > - zg.GetCore()->RegisterClassObject(new CLASS(CCylinder), "kerosin/"); > + zg.GetCore()->RegisterClassObject(new CLASS(Capsule), "kerosin/"); > zg.GetCore()->RegisterClassObject(new CLASS(Cylinder), "kerosin/"); > zg.GetCore()->RegisterClassObject(new CLASS(Sphere), "kerosin/"); > > > Modified: branches/multiphys/spark/lib/kerosin/kerosin.h > =================================================================== > --- branches/multiphys/spark/lib/kerosin/kerosin.h 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/spark/lib/kerosin/kerosin.h 2009-12-10 08:34:56 UTC (rev 118) > @@ -61,7 +61,7 @@ > #include "sceneserver/axis.h" > #include "sceneserver/light.h" > #include "sceneserver/sphere.h" > -#include "sceneserver/ccylinder.h" > +#include "sceneserver/capsule.h" > #include "sceneserver/cylinder.h" > #include "sceneserver/staticmesh.h" > > > Added: branches/multiphys/spark/lib/kerosin/sceneserver/capsule.cpp > =================================================================== > --- branches/multiphys/spark/lib/kerosin/sceneserver/capsule.cpp (rev 0) > +++ branches/multiphys/spark/lib/kerosin/sceneserver/capsule.cpp 2009-12-10 08:34:56 UTC (rev 118) > @@ -0,0 +1,65 @@ > +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- > + > + this file is part of rcssserver3D > + Fri May 9 2003 > + Copyright (C) 2002,2003 Koblenz University > + Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group > + $Id: capsule.cpp 3 2008-11-21 02:38:08Z hedayat $ > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; version 2 of the License. > + > + This program 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 > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program; if not, write to the Free Software > + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > +*/ > +#include "capsule.h" > +#include<kerosin/openglserver/openglserver.h> > +#include<kerosin/materialserver/material.h> > + > +using namespace boost; > +using namespace kerosin; > +using namespace zeitgeist; > +using namespace salt; > + > +Capsule::Capsule() : SingleMatNode() > +{ > +} > + > +Capsule::~Capsule() > +{ > +} > + > +void Capsule::SetParams(float radius, float length) > +{ > + ParameterList parameter; > + parameter.AddValue(radius); > + parameter.AddValue(length); > + > + Load("StdCapsule",parameter); > + > + mRadius = radius; > + mLength = length; > +} > + > +void Capsule::GetParams(float& radius, float& length) const > +{ > + radius = mRadius; > + length = mLength; > +} > + > +float Capsule::GetRadius() > +{ > + return mRadius; > +} > + > +float Capsule::GetLength() > +{ > + return mLength; > +} > > Added: branches/multiphys/spark/lib/kerosin/sceneserver/capsule.h > =================================================================== > --- branches/multiphys/spark/lib/kerosin/sceneserver/capsule.h (rev 0) > +++ branches/multiphys/spark/lib/kerosin/sceneserver/capsule.h 2009-12-10 08:34:56 UTC (rev 118) > @@ -0,0 +1,78 @@ > +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- > + > + this file is part of rcssserver3D > + Fri May 9 2003 > + Copyright (C) 2002,2003 Koblenz University > + Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group > + $Id: capsule.h 57 2009-03-18 07:26:56Z hedayat $ > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; version 2 of the License. > + > + This program 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 > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program; if not, write to the Free Software > + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > +*/ > +#ifndef KEROSIN_CAPSULE_H > +#define KEROSIN_CAPSULE_H > + > +#include<kerosin/kerosin_defines.h> > +#include "singlematnode.h" > + > +namespace kerosin > +{ > +class Material; > + > +/** Capsule is a SingleMatNode that creates and renders a capsule > + mesh with the given length and radius > + */ > +class KEROSIN_API Capsule : public SingleMatNode > +{ > + // > + // Function > + // > +public: > + Capsule(); > + virtual ~Capsule(); > + > + /** sets the parameters of the capsule. > + > + \param radius is the radius of the caps, and of the cylinder > + itself > + > + \param length is the height of the cylinder, not counting the > + caps > + */ > + void SetParams(float radius, float length); > + > + /** returns the parameters of the capsule */ > + void GetParams(float& radius, float& length) const; > + > + /** returns the radius of the capsule */ > + float GetRadius(); > + > + /** returns the length of the capsule */ > + float GetLength(); > + > + // > + // Members > + // > +protected: > + /** the radius of the caps and the cylinder */ > + float mRadius; > + > + /** the height of the clinder, not counting the caps */ > + float mLength; > +}; > + > +DECLARE_CLASS(Capsule); > + > +} //namespace kerosin > + > +#endif //KEROSIN_CAPSULE_H > > Added: branches/multiphys/spark/lib/kerosin/sceneserver/capsule_c.cpp > =================================================================== > --- branches/multiphys/spark/lib/kerosin/sceneserver/capsule_c.cpp (rev 0) > +++ branches/multiphys/spark/lib/kerosin/sceneserver/capsule_c.cpp 2009-12-10 08:34:56 UTC (rev 118) > @@ -0,0 +1,62 @@ > +/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- > + > + this file is part of rcssserver3D > + Fri May 9 2003 > + Copyright (C) 2002,2003 Koblenz University > + Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group > + $Id: capsule_c.cpp 3 2008-11-21 02:38:08Z hedayat $ > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; version 2 of the License. > + > + This program 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 > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program; if not, write to the Free Software > + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > +*/ > +#include "capsule.h" > + > +using namespace boost; > +using namespace kerosin; > +using namespace salt; > + > +FUNCTION(Capsule,setParams) > +{ > + float inRadius; > + float inLength; > + > + if ( > + (in.GetSize() != 2) || > + (! in.GetValue(in[0], inRadius)) || > + (! in.GetValue(in[1], inLength)) > + ) > + { > + return false; > + } > + > + obj->SetParams(inRadius,inLength); > + return true; > +} > + > +FUNCTION(Capsule,getRadius) > +{ > + return obj->GetRadius(); > +} > + > +FUNCTION(Capsule,getLength) > +{ > + return obj->GetLength(); > +} > + > +void CLASS(Capsule)::DefineClass() > +{ > + DEFINE_BASECLASS(kerosin/SingleMatNode); > + DEFINE_FUNCTION(setParams); > + DEFINE_FUNCTION(getRadius); > + DEFINE_FUNCTION(getLength); > +} > > Deleted: branches/multiphys/spark/lib/kerosin/sceneserver/ccylinder.cpp > =================================================================== > --- branches/multiphys/spark/lib/kerosin/sceneserver/ccylinder.cpp 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/spark/lib/kerosin/sceneserver/ccylinder.cpp 2009-12-10 08:34:56 UTC (rev 118) > @@ -1,65 +0,0 @@ > -/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- > - > - this file is part of rcssserver3D > - Fri May 9 2003 > - Copyright (C) 2002,2003 Koblenz University > - Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group > - $Id$ > - > - This program is free software; you can redistribute it and/or modify > - it under the terms of the GNU General Public License as published by > - the Free Software Foundation; version 2 of the License. > - > - This program 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 > - GNU General Public License for more details. > - > - You should have received a copy of the GNU General Public License > - along with this program; if not, write to the Free Software > - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > -*/ > -#include "ccylinder.h" > -#include<kerosin/openglserver/openglserver.h> > -#include<kerosin/materialserver/material.h> > - > -using namespace boost; > -using namespace kerosin; > -using namespace zeitgeist; > -using namespace salt; > - > -CCylinder::CCylinder() : SingleMatNode() > -{ > -} > - > -CCylinder::~CCylinder() > -{ > -} > - > -void CCylinder::SetParams(float radius, float length) > -{ > - ParameterList parameter; > - parameter.AddValue(radius); > - parameter.AddValue(length); > - > - Load("StdCCylinder",parameter); > - > - mRadius = radius; > - mLength = length; > -} > - > -void CCylinder::GetParams(float& radius, float& length) const > -{ > - radius = mRadius; > - length = mLength; > -} > - > -float CCylinder::GetRadius() > -{ > - return mRadius; > -} > - > -float CCylinder::GetLength() > -{ > - return mLength; > -} > > Deleted: branches/multiphys/spark/lib/kerosin/sceneserver/ccylinder.h > =================================================================== > --- branches/multiphys/spark/lib/kerosin/sceneserver/ccylinder.h 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/spark/lib/kerosin/sceneserver/ccylinder.h 2009-12-10 08:34:56 UTC (rev 118) > @@ -1,78 +0,0 @@ > -/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- > - > - this file is part of rcssserver3D > - Fri May 9 2003 > - Copyright (C) 2002,2003 Koblenz University > - Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group > - $Id$ > - > - This program is free software; you can redistribute it and/or modify > - it under the terms of the GNU General Public License as published by > - the Free Software Foundation; version 2 of the License. > - > - This program 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 > - GNU General Public License for more details. > - > - You should have received a copy of the GNU General Public License > - along with this program; if not, write to the Free Software > - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > -*/ > -#ifndef KEROSIN_CCYLINDER_H > -#define KEROSIN_CCYLINDER_H > - > -#include<kerosin/kerosin_defines.h> > -#include "singlematnode.h" > - > -namespace kerosin > -{ > -class Material; > - > -/** CCylinder is a SingleMatNode that creates and renders a capped > - cylinder mesh with the given length and radius > - */ > -class KEROSIN_API CCylinder : public SingleMatNode > -{ > - // > - // Function > - // > -public: > - CCylinder(); > - virtual ~CCylinder(); > - > - /** sets the parameters of the capped cylinder. > - > - \param radius is the radius of the caps, and of the cylinder > - itself > - > - \param length is the height of the cylinder, not counting the > - caps > - */ > - void SetParams(float radius, float length); > - > - /** returns the parameters of the capped cylinder */ > - void GetParams(float& radius, float& length) const; > - > - /** returns the radius of the capped cylinder */ > - float GetRadius(); > - > - /** returns the length of the capped cylinder */ > - float GetLength(); > - > - // > - // Members > - // > -protected: > - /** the radius of the caps and the cylinder */ > - float mRadius; > - > - /** the height of the clinder, not counting the caps */ > - float mLength; > -}; > - > -DECLARE_CLASS(CCylinder); > - > -} //namespace kerosin > - > -#endif //KEROSIN_CCYLINDER_H > > Deleted: branches/multiphys/spark/lib/kerosin/sceneserver/ccylinder_c.cpp > =================================================================== > --- branches/multiphys/spark/lib/kerosin/sceneserver/ccylinder_c.cpp 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/spark/lib/kerosin/sceneserver/ccylinder_c.cpp 2009-12-10 08:34:56 UTC (rev 118) > @@ -1,62 +0,0 @@ > -/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- > - > - this file is part of rcssserver3D > - Fri May 9 2003 > - Copyright (C) 2002,2003 Koblenz University > - Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group > - $Id$ > - > - This program is free software; you can redistribute it and/or modify > - it under the terms of the GNU General Public License as published by > - the Free Software Foundation; version 2 of the License. > - > - This program 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 > - GNU General Public License for more details. > - > - You should have received a copy of the GNU General Public License > - along with this program; if not, write to the Free Software > - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > -*/ > -#include "ccylinder.h" > - > -using namespace boost; > -using namespace kerosin; > -using namespace salt; > - > -FUNCTION(CCylinder,setParams) > -{ > - float inRadius; > - float inLength; > - > - if ( > - (in.GetSize() != 2) || > - (! in.GetValue(in[0], inRadius)) || > - (! in.GetValue(in[1], inLength)) > - ) > - { > - return false; > - } > - > - obj->SetParams(inRadius,inLength); > - return true; > -} > - > -FUNCTION(CCylinder,getRadius) > -{ > - return obj->GetRadius(); > -} > - > -FUNCTION(CCylinder,getLength) > -{ > - return obj->GetLength(); > -} > - > -void CLASS(CCylinder)::DefineClass() > -{ > - DEFINE_BASECLASS(kerosin/SingleMatNode); > - DEFINE_FUNCTION(setParams); > - DEFINE_FUNCTION(getRadius); > - DEFINE_FUNCTION(getLength); > -} > > Modified: branches/multiphys/spark/lib/oxygen/CMakeLists.txt > =================================================================== > --- branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/spark/lib/oxygen/CMakeLists.txt 2009-12-10 08:34:56 UTC (rev 118) > @@ -14,6 +14,7 @@ > gamecontrolserver/behavior.h > oxygen.h > oxygen_defines.h > + physicsserver/genericphysicsobject.h > physicsserver/physicsobject.h > physicsserver/body.h > physicsserver/rigidbody.h > @@ -56,9 +57,11 @@ > #interfaces > physicsserver/int/bodyint.h > physicsserver/int/boxcolliderint.h > + physicsserver/int/capsulecolliderint.h > physicsserver/int/colliderint.h > physicsserver/int/compoundcolliderint.h > physicsserver/int/concavecolliderint.h > + physicsserver/int/conecolliderint.h > physicsserver/int/convexcolliderint.h > physicsserver/int/cylindercolliderint.h > physicsserver/int/dynamicbodyint.h > @@ -76,9 +79,11 @@ > physicsserver/ode/odebody.h > physicsserver/ode/odeboxcollider.h > physicsserver/ode/odedynamicbody.h > + physicsserver/ode/odecapsulecollider.h > physicsserver/ode/odecollider.h > physicsserver/ode/odecompoundcollider.h > physicsserver/ode/odeconcavecollider.h > + physicsserver/ode/odeconecollider.h > physicsserver/ode/odeconvexcollider.h > physicsserver/ode/odecylindercollider.h > physicsserver/ode/odeemptycollider.h > @@ -177,6 +182,7 @@ > physicsserver/compoundcollider_c.cpp > physicsserver/concavecollider.cpp > physicsserver/concavecollider_c.cpp > + physicsserver/conecollider.cpp > physicsserver/conecollider_c.cpp > physicsserver/convexcollider.cpp > physicsserver/convexcollider_c.cpp > @@ -228,9 +234,11 @@ > #ODE-specific files > physicsserver/ode/odebody.cpp > physicsserver/ode/odeboxcollider.cpp > + physicsserver/ode/odecapsulecollider.cpp > physicsserver/ode/odecollider.cpp > physicsserver/ode/odecompoundcollider.cpp > physicsserver/ode/odeconcavecollider.cpp > + physicsserver/ode/odeconecollider.cpp > physicsserver/ode/odeconvexcollider.cpp > physicsserver/ode/odecylindercollider.cpp > physicsserver/ode/odedynamicbody.cpp > > Modified: branches/multiphys/spark/lib/oxygen/geometryserver/stdmeshimporter.cpp > =================================================================== > --- branches/multiphys/spark/lib/oxygen/geometryserver/stdmeshimporter.cpp 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/spark/lib/oxygen/geometryserver/stdmeshimporter.cpp 2009-12-10 08:34:56 UTC (rev 118) > @@ -40,7 +40,7 @@ > > static const string gSphereStr = "StdUnitSphere"; > static const string gBoxStr = "StdUnitBox"; > -static const string gCCylinderStr = "StdCCylinder"; > +static const string gCapsuleStr = "StdCapsule"; > static const string gCylinderStr = "StdUnitCylinder"; > > shared_ptr<TriMesh> > @@ -56,9 +56,9 @@ > return UnitBoxMesh(); > } > > - if (name == gCCylinderStr) > + if (name == gCapsuleStr) > { > - return UnitCCylinder(parameter); > + return UnitCapsule(parameter); > } > > if (name == gCylinderStr) > @@ -253,7 +253,7 @@ > } > > // > -// unit capped cylinder > +// unit capsule > // > static void AddVertex(float** at, float x, float y, float z) > { > @@ -265,7 +265,7 @@ > std::string StdMeshImporter::MangleName (const string& name, const ParameterList& parameter) > { > if ( > - (name != gCCylinderStr) || > + (name != gCapsuleStr) || > (parameter.GetSize()< 2) > ) > { > @@ -273,7 +273,7 @@ > } > > stringstream ss; > - ss<< gCCylinderStr; > + ss<< gCapsuleStr; > > float radius; > if (parameter.GetValue(parameter[0],radius)) > @@ -290,18 +290,18 @@ > return ss.str(); > } > > -shared_ptr<TriMesh> StdMeshImporter::UnitCCylinder(const ParameterList& parameter) > +shared_ptr<TriMesh> StdMeshImporter::UnitCapsule(const ParameterList& parameter) > { > // > // code adapted from ODE's drawstuff lib > // > > - // generated capped clinder with r=1 and l=1 > + // generated capsule with r=1 and l=1 > float ccRadius = 1; > float ccLength = 1; > > GetLog()->Debug() > -<< "(StdMeshImporter::UnitCCylinder) paramSize=" > +<< "(StdMeshImporter::UnitCapsule) paramSize=" > << parameter.GetSize()<< "\n"; > if (parameter.GetSize()>= 2) > { > @@ -310,8 +310,8 @@ > } > > // number of sides to the cylinder (divisible by 4): > - const int capped_cylinder_quality = 3; > - const int n = capped_cylinder_quality*4; > + const int capsule_quality = 3; > + const int n = capsule_quality*4; > > int innerLoop = (n+1); > int numVertices = innerLoop * 2; > @@ -447,7 +447,7 @@ > mesh->SetPos(pos,numVertices); > mesh->SetNormals(normals); > mesh->AddFace(idx); > - mesh->SetName(MangleName(gCCylinderStr,parameter)); > + mesh->SetName(MangleName(gCapsuleStr,parameter)); > > return mesh; > } > > Modified: branches/multiphys/spark/lib/oxygen/geometryserver/stdmeshimporter.h > =================================================================== > --- branches/multiphys/spark/lib/oxygen/geometryserver/stdmeshimporter.h 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/spark/lib/oxygen/geometryserver/stdmeshimporter.h 2009-12-10 08:34:56 UTC (rev 118) > @@ -28,7 +28,7 @@ > namespace oxygen > { > /** \class StdMeshImporter is a MeshImporter that generates a standard > - set of meshes. These are spheres, boxes and capped cylinders. > + set of meshes. These are spheres, boxes and capsule. > */ > class OXYGEN_API StdMeshImporter : public MeshImporter > { > @@ -41,7 +41,7 @@ > virtual boost::shared_ptr<TriMesh> ImportMesh > (const std::string& name,const zeitgeist::ParameterList& parameter); > > - /** returns a unique name for each parameterized capped cylinder > + /** returns a unique name for each parameterized capsule > mesh, and \param name otherwise > */ > virtual std::string MangleName > @@ -54,8 +54,8 @@ > /** constructs a unit box */ > boost::shared_ptr<TriMesh> UnitBoxMesh(); > > - /** constructs a unit capped cylinder */ > - boost::shared_ptr<TriMesh> UnitCCylinder > + /** constructs a unit capsule */ > + boost::shared_ptr<TriMesh> UnitCapsule > (const zeitgeist::ParameterList& parameter); > > /** constructs a flat unit cylinder */ > > Modified: branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp > =================================================================== > --- branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp 2009-12-09 08:42:42 UTC (rev 117) > +++ branches/multiphys/spark/lib/oxygen/physicsserver/capsulecollider.cpp 2009-12-10 08:34:56 UTC (rev 118) > @@ -3,7 +3,7 @@ > this file is part of rcssserver3D > Fri May 9 2003 > Copyright (C) 2003 Koblenz University > - $Id: ccylindercollider.cpp 108 2009-11-25 10:20:10Z a-held $ > + $Id: capsulecollider.cpp 108 2009-11-25 10:20:10Z a-held $ > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > @@ -20,51 +20,44 @@ > */ > > #include<oxygen/physicsserver/capsulecollider.h> > +#include<oxygen... [truncated message content] |