Page 1 of 1

Ray Implementation ? Default Copy Constructor

Posted: Mon May 09, 2005 7:43 pm
by Yavin
Hello Ogre::Team,

while working on some new JavaBindings I'm a little bit confused about the implementation of the Ogre::Ray class. Is it aim that the copy constructor isn't private or overloaded? I want to get a Ray object from Camera, but I need the object on the heap in order that it is alive when the scope goes back to Java. To make this work I will try the following:

Code: Select all

Ogre::Ray * pRay = new Ogre::Ray( pCam->getCameraToViewportRay( screenx, screeny ) );
Maybe someone can please tell me if this would be a good idea or not! IMHO that's not very nice.

Regards, Yavin

Posted: Mon May 09, 2005 8:05 pm
by jacmoe
You are aware of Ogre4J ? (The Ogre java bindings in ogreaddons) :)

Posted: Tue May 10, 2005 9:55 am
by Yavin
jacmoe wrote:You are aware of Ogre4J ?
Thanks for that hint but I'm one of the new maintainers of Ogre4J. On this account I am aware of Ogre4J!

Posted: Tue May 10, 2005 10:35 am
by monster
Yavin wrote:
jacmoe wrote:You are aware of Ogre4J ?
Thanks for that hint but I'm one of the new maintainers of Ogre4J. On this account I am aware of Ogre4J!
Touché!
Image

Posted: Tue May 10, 2005 11:24 am
by :wumpus:
pCam->getCameraToViewportRay returns an Ogre::Ray object, so it is very legal to use the copy constructor. (otherwise this return value wouldn't even work)