From: <kal...@us...> - 2009-12-28 09:48:06
|
Revision: 2773 http://ogreaddons.svn.sourceforge.net/ogreaddons/?rev=2773&view=rev Author: kallaspriit Date: 2009-12-28 09:47:53 +0000 (Mon, 28 Dec 2009) Log Message: ----------- Updated the Minimal OgreNewt Application demo. Modified Paths: -------------- branches/ogrenewt/newton20/demos/MinimalOgreNewtApplication/MinimalOgreNewt.sln branches/ogrenewt/newton20/demos/MinimalOgreNewtApplication/MinimalOgreNewt.suo branches/ogrenewt/newton20/demos/MinimalOgreNewtApplication/source/Application.cpp branches/ogrenewt/newton20/demos/MinimalOgreNewtApplication/source/PrimitiveFactory.cpp branches/ogrenewt/newton20/inc/OgreNewt_BasicJoints.h branches/ogrenewt/newton20/src/OgreNewt_BasicJoints.cpp Modified: branches/ogrenewt/newton20/demos/MinimalOgreNewtApplication/MinimalOgreNewt.sln =================================================================== --- branches/ogrenewt/newton20/demos/MinimalOgreNewtApplication/MinimalOgreNewt.sln 2009-12-26 17:31:51 UTC (rev 2772) +++ branches/ogrenewt/newton20/demos/MinimalOgreNewtApplication/MinimalOgreNewt.sln 2009-12-28 09:47:53 UTC (rev 2773) @@ -2,7 +2,12 @@ Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MinimalOgreNewt", "MinimalOgreNewt.vcproj", "{44F65D14-7093-4B8F-BE0F-95D5D31CFBBC}" + ProjectSection(ProjectDependencies) = postProject + {C28C7710-76B1-4FFD-A85A-9AEFDA25EE64} = {C28C7710-76B1-4FFD-A85A-9AEFDA25EE64} + EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OgreNewt", "C:\Ogre3D\Addons\OgreNewt\OgreNewt.vcproj", "{C28C7710-76B1-4FFD-A85A-9AEFDA25EE64}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -13,6 +18,10 @@ {44F65D14-7093-4B8F-BE0F-95D5D31CFBBC}.Debug|Win32.Build.0 = Debug|Win32 {44F65D14-7093-4B8F-BE0F-95D5D31CFBBC}.Release|Win32.ActiveCfg = Release|Win32 {44F65D14-7093-4B8F-BE0F-95D5D31CFBBC}.Release|Win32.Build.0 = Release|Win32 + {C28C7710-76B1-4FFD-A85A-9AEFDA25EE64}.Debug|Win32.ActiveCfg = Debug|Win32 + {C28C7710-76B1-4FFD-A85A-9AEFDA25EE64}.Debug|Win32.Build.0 = Debug|Win32 + {C28C7710-76B1-4FFD-A85A-9AEFDA25EE64}.Release|Win32.ActiveCfg = Release|Win32 + {C28C7710-76B1-4FFD-A85A-9AEFDA25EE64}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: branches/ogrenewt/newton20/demos/MinimalOgreNewtApplication/MinimalOgreNewt.suo =================================================================== (Binary files differ) Modified: branches/ogrenewt/newton20/demos/MinimalOgreNewtApplication/source/Application.cpp =================================================================== --- branches/ogrenewt/newton20/demos/MinimalOgreNewtApplication/source/Application.cpp 2009-12-26 17:31:51 UTC (rev 2772) +++ branches/ogrenewt/newton20/demos/MinimalOgreNewtApplication/source/Application.cpp 2009-12-28 09:47:53 UTC (rev 2773) @@ -289,6 +289,31 @@ body->setCenterOfMass(centerOfMass); body->setStandardForceCallback(); + + // Lets create a simple vehicle-like object + Ogre::Vector3 pos(0, 1, 8); + + // Create two frame parts + OgreNewt::Body* rearFrame = PrimitiveFactory::getSingleton().createBox("RearFrame", "Debug/Blue", 600, pos + Ogre::Vector3(0.0f, 0.0f, 1.5f), Ogre::Vector3(2.0f, 1.0f, 2.75f)); + OgreNewt::Body* frontFrame = PrimitiveFactory::getSingleton().createBox("FrontFrame", "Debug/Blue", 600, pos + Ogre::Vector3(0.0f, 0.0f, -1.5f), Ogre::Vector3(2.0f, 1.0f, 2.75f)); + + // Create the wheels + OgreNewt::Body* wheelRR = PrimitiveFactory::getSingleton().createCylinder("WheelRR", "Debug/Red", 20, pos + Ogre::Vector3(1.35f, 0.0f, 2.0f), 1.0f, 0.6f, Ogre::Quaternion(Ogre::Degree(90), Ogre::Vector3::UNIT_Z)); + OgreNewt::Body* wheelRL = PrimitiveFactory::getSingleton().createCylinder("WheelRL", "Debug/Red", 20, pos + Ogre::Vector3(-1.35f, 0.0f, 2.0f), 1.0f, 0.6f, Ogre::Quaternion(Ogre::Degree(90), Ogre::Vector3::UNIT_Z)); + OgreNewt::Body* wheelFR = PrimitiveFactory::getSingleton().createCylinder("WheelFR", "Debug/Red", 20, pos + Ogre::Vector3(1.35f, 0.0f, -2.0f), 1.0f, 0.6f, Ogre::Quaternion(Ogre::Degree(90), Ogre::Vector3::UNIT_Z)); + OgreNewt::Body* wheelFL = PrimitiveFactory::getSingleton().createCylinder("WheelFL", "Debug/Red", 20, pos + Ogre::Vector3(-1.35f, 0.0f, -2.0f), 1.0f, 0.6f, Ogre::Quaternion(Ogre::Degree(90), Ogre::Vector3::UNIT_Z)); + + // Create hinges to attach the wheels to the frame + OgreNewt::Joint* wheelRRhinge = new OgreNewt::Hinge(wheelRR, rearFrame, pos + Ogre::Vector3(1.35f, 0.0f, 2.0f), Ogre::Vector3::UNIT_X); + OgreNewt::Joint* wheelRLhinge = new OgreNewt::Hinge(wheelRL, rearFrame, pos + Ogre::Vector3(-1.35f, 0.0f, 2.0f), Ogre::Vector3::UNIT_X); + OgreNewt::Joint* wheelFRhinge = new OgreNewt::Hinge(wheelFR, frontFrame, pos + Ogre::Vector3(1.35f, 0.0f, -2.0f), Ogre::Vector3::UNIT_X); + OgreNewt::Joint* wheelFLhinge = new OgreNewt::Hinge(wheelFL, frontFrame, pos + Ogre::Vector3(-1.35f, 0.0f, -2.0f), Ogre::Vector3::UNIT_X); + + // Create a center hinge to attach the two frames and apply some limits + OgreNewt::Hinge* centerHinge = new OgreNewt::Hinge(frontFrame, rearFrame, pos, Ogre::Vector3::UNIT_Z); + centerHinge->enableLimits(true); + centerHinge->setLimits(Ogre::Degree(-60), Ogre::Degree(60)); + return true; } Modified: branches/ogrenewt/newton20/demos/MinimalOgreNewtApplication/source/PrimitiveFactory.cpp =================================================================== --- branches/ogrenewt/newton20/demos/MinimalOgreNewtApplication/source/PrimitiveFactory.cpp 2009-12-26 17:31:51 UTC (rev 2772) +++ branches/ogrenewt/newton20/demos/MinimalOgreNewtApplication/source/PrimitiveFactory.cpp 2009-12-28 09:47:53 UTC (rev 2773) @@ -223,7 +223,7 @@ OgreNewt::Body* PrimitiveFactory::createCylinder(Ogre::String name, Ogre::String material, Ogre::Real mass, Ogre::Vector3 position, float radius, float height, Ogre::Quaternion orientation, OgreNewt::MaterialID* materialId, int objectId, Ogre::String mesh) { - Ogre::Vector3 scale(radius * 2, radius * 2, height); + Ogre::Vector3 scale(radius * 2, height, radius * 2); Ogre::SceneNode* node = createNode(mesh, name, material, position, scale, orientation); Modified: branches/ogrenewt/newton20/inc/OgreNewt_BasicJoints.h =================================================================== --- branches/ogrenewt/newton20/inc/OgreNewt_BasicJoints.h 2009-12-26 17:31:51 UTC (rev 2772) +++ branches/ogrenewt/newton20/inc/OgreNewt_BasicJoints.h 2009-12-28 09:47:53 UTC (rev 2773) @@ -89,7 +89,7 @@ void enableLimits(bool state); //! set minimum and maximum hinge limits. - void setLimis(Ogre::Radian minAngle, Ogre::Radian maxAngle); + void setLimits(Ogre::Radian minAngle, Ogre::Radian maxAngle); }; Modified: branches/ogrenewt/newton20/src/OgreNewt_BasicJoints.cpp =================================================================== --- branches/ogrenewt/newton20/src/OgreNewt_BasicJoints.cpp 2009-12-26 17:31:51 UTC (rev 2772) +++ branches/ogrenewt/newton20/src/OgreNewt_BasicJoints.cpp 2009-12-28 09:47:53 UTC (rev 2773) @@ -71,7 +71,7 @@ } -void Hinge::setLimis(Ogre::Radian minAngle, Ogre::Radian maxAngle) +void Hinge::setLimits(Ogre::Radian minAngle, Ogre::Radian maxAngle) { CustomHinge* joint = (CustomHinge*) GetSupportJoint(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |