About Store Forum Documentation Contact
Donations:
207$/mo



Post Reply 
Access to objects
Author Message
Harton Offline
Member

Post: #1
Access to objects
While writing the tools I need access to the container objects in the scene. Is it possible to get an easy way to objects in the world? How can I get a pointer to the object it points to the mouse?
04-05-2012 08:54 PM
Visit this user's website Find all posts by this user Quote this message in a reply
JonathonA Offline
Member

Post: #2
RE: Access to objects
Hi Harton, not sure if this is what you are looking for but the Game::World.init(...).setObjType(...) is used to define containers to store objects from the world so I imagine you can access them through that?

To get the object under the mouse you'd have to cast a ray I imagine and if it collides with something then the PhysHit class I believe contains a pointer to whatever it has collided with.
04-05-2012 09:42 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Harton Offline
Member

Post: #3
RE: Access to objects
Hi JonathonA! smile

Function 'Edit::World.setObjType' changes class which manage objects of type specified in the argument.

Raycast, I completely forgot. smile Just try it. Thanks. wink
(This post was last modified: 04-05-2012 10:25 PM by Harton.)
04-05-2012 10:22 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Harton Offline
Member

Post: #4
RE: Access to objects
Unfortunately, the raycast method did`t work. Received pointer is random and incorrect.
04-07-2012 05:40 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #5
RE: Access to objects
Physics.ray isn't random it returns what the mouse screen to pos matrix would hit. Unless there is something else you mean by random?
04-07-2012 08:51 PM
Find all posts by this user Quote this message in a reply
JonathonA Offline
Member

Post: #6
RE: Access to objects
Describe how its incorrect if you can, might help narrow down the problem and maybe post code
04-07-2012 09:03 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
RE: Access to objects
there is no physics in the world editor.
there are only EE::World.obj,objs which allows to get object params and position
if you want I can enable isSelected isHighlighted methods for world object (EE::Edit::Obj) in the edit stage, just let me know
04-08-2012 09:06 AM
Find all posts by this user Quote this message in a reply
Harton Offline
Member

Post: #8
RE: Access to objects
Maybe I'll explain what I want to do. smile
I would select object using mouse and next I would like set objects group which I can show or hide in game. Now I can't receive pointer to object. I don't know how can I select object in world.
05-03-2012 07:20 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #9
RE: Access to objects
why not set custom parameter for the object in object mode?

you have Ms.pos(), ScreenToPos, PosToScreen, World.obj, World.obj[i].pos()
05-04-2012 05:13 AM
Find all posts by this user Quote this message in a reply
Harton Offline
Member

Post: #10
RE: Access to objects
Thanks! smile A different approach and I got lost. wink I was able to select objects but selection is quite crude.
I wish I could select objects as it is nicely done in the 'Object' bookmark in the World Editor. Would you like to help me sample code?
At this moment the biggest difficulty for me to detect the object boundaries.
05-05-2012 05:00 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply