Object::setShape with SceneNode

Altren

29-05-2010 00:11:04

I added Object::setShape that use given SceneNode instead of creating new one (similar function used in RigidBody).
Index: include/OgreBulletCollisionsObject.h
===================================================================
--- include/OgreBulletCollisionsObject.h (revision 2907)
+++ include/OgreBulletCollisionsObject.h (working copy)
@@ -90,6 +90,10 @@
void setShape(CollisionShape *shape,
const Ogre::Vector3 &pos,
const Ogre::Quaternion &quat);
+ void setShape(Ogre::SceneNode *node,
+ CollisionShape *shape,
+ const Ogre::Vector3 &pos,
+ const Ogre::Quaternion &quat);
void showDebugShape(bool show);

Ogre::SceneNode *getRootNode() { return mRootNode; }
Index: src/OgreBulletCollisionsObject.cpp
===================================================================
--- src/OgreBulletCollisionsObject.cpp (revision 2907)
+++ src/OgreBulletCollisionsObject.cpp (working copy)
@@ -146,6 +146,29 @@
mObject->getWorldTransform().setRotation(btQuaternion(quat.x, quat.y, quat.z, quat.w));

}
+ //-----------------------------------------------------------------------
+ void Object::setShape(Ogre::SceneNode *node,
+ CollisionShape *shape,
+ const Vector3 &pos,
+ const Quaternion &quat)
+ {
+ mShape = shape;
+
+ mRootNode = node;
+
+ mShapeNode = mRootNode->createChildSceneNode(mName + "Shape");
+ mShapeNode->attachObject(this);
+
+ node->setPosition (pos);
+ node->setOrientation (quat);
+
+ mObject->setCollisionShape(shape->getBulletShape());
+ showDebugShape(mWorld->getShowDebugShapes());
+
+ mObject->getWorldTransform().setOrigin(btVector3(pos.x, pos.y, pos.z));
+ mObject->getWorldTransform().setRotation(btQuaternion(quat.x, quat.y, quat.z, quat.w));
+
+ }
// -------------------------------------------------------------------------
//-----------------------------------------------------------------------
void Object::_notifyAttached(Node* parent, bool isTagPoint)
@@ -198,4 +221,3 @@
{
}
}
-


Also I just realized that OgreBullet licensed under GPL now - not LGPL. And I can't use it any more, because my application is not Open Source :(
Why OgreBullet is not LGPL? LGPL gives possibility to use it in DLL form in closed-source applications.

Fish

30-05-2010 01:22:51

Also I just realized that OgreBullet licensed under GPL now - not LGPL. And I can't use it any more, because my application is not Open Source :(
Why OgreBullet is not LGPL? LGPL gives possibility to use it in DLL form in closed-source applications.


Thanks for the patch.

hmm...it's confusing. The files in the root directory "OgreBullet_LGPL.txt" and "OgreBullet_licence.txt" both refer to the LGPL but the source/header files indicate GPL. Maybe Tuan can shed some light on it?

- Fish

Altren

30-05-2010 17:07:55

Here's the only words about license that I found
I intended to change OgreBullet license to something more liberal, and found the GPL with runtime exception (allows static and dynamic linking, but any change to the library need to be opensourced )

Is that ok ?
(from this topic viewtopic.php?f=12&t=4155)

But even if he changed license to GPL with runtime exception this exception must be noted in source files too.

tuan kuranes

31-05-2010 12:27:52

But even if he changed license to GPL with runtime exception this exception must be noted in source files too.
I think it's already the case in the source, headers have a GPL + exceptions license.

GPL with exception allows you to link it dynamically and statically without having to opensource your code.

Whatever, now I'm more for a "do whatever you wish license, and that would be very cool if you provide patches and bug report" sort of license.

(that, a and a please post patch on the ogreaddons sourceforge patch tracker...)

Fish

01-06-2010 01:58:20

The source files refer to GPL + RT exception, but the .txt files refer to LGPL. Did you intend GPL + RT exception or LGPL?