Ray Implementation ? Default Copy Constructor

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
User avatar
Yavin
Bronze Sponsor
Bronze Sponsor
Posts: 140
Joined: Wed Mar 02, 2005 3:41 pm
Location: Lake Constance, Germany
Contact:

Ray Implementation ? Default Copy Constructor

Post 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

User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

You are aware of Ogre4J ? (The Ogre java bindings in ogreaddons) :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.

User avatar
Yavin
Bronze Sponsor
Bronze Sponsor
Posts: 140
Joined: Wed Mar 02, 2005 3:41 pm
Location: Lake Constance, Germany
Contact:

Post 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!

User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post 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

User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post 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)

Post Reply