About Store Forum Documentation Contact



Post Reply 
Camera Collision Question
Author Message
gusrbehfdl Offline
Member

Post: #1
Camera Collision Question
I'm looking at Camera Collision tutorial code

I found that the Physical ball for camera collision will detect anything that interferes with itself.(including terrain, models...)

Physics.move(ball, desired_camera.matrix.pos-ball.pos);
// use physics movement to move the ball as far as it can go without any collisions

Is there an easy way to change this camera to collide only with terrain & static objects?
12-16-2010 09:34 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #2
RE: Camera Collision Question
Something like this I believe:

Code:
Physics.move(ball, desired_camera.matrix.pos-ball.pos, ~IndexToFlag(AG_TERRAIN) | ~IndexToFlag(AG_STATIC));
12-17-2010 01:26 AM
Find all posts by this user Quote this message in a reply
gusrbehfdl Offline
Member

Post: #3
RE: Camera Collision Question
Thanks for the reply,

Physics.move(ball, desired_camera.matrix.pos-ball.pos, ~IndexToFlag(AG_CONTROLLER));

this works for the Characters, but I think I need to make custom Actor groups to handle more objects(items..etc[/align])

do you know how to make custom(user defined) Actor Groups?

enum ACTOR_GROUP // Actor Group (Actor::group)
{
AG_DEFAULT=0, // default group for all actors

// user defined groups should be in the range of 1..15

AG_CONTROLLER=28, // Controller
AG_DOOR =29, // Game::Door
AG_STATIC =30, // Game::Static
AG_TERRAIN =31, // Game::World Terrain
AG_NUM =32, // number of actor groups
};
12-17-2010 04:59 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #4
RE: Camera Collision Question
I don't think it's possible to extend the default actor groups, but I may be wrong. You can either make another enum for your own or just enter the number directly (i.e. ~IndexToFlag(1)). Just make sure to assign the correct group to the actors you need (i.e. actor.group(1)).
12-17-2010 06:14 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #5
RE: Camera Collision Question
You can make custom enum for example
Enum ACTOR_GROUP_CUSTOM
{
AG_CUSTOM=1
12-17-2010 11:14 AM
Find all posts by this user Quote this message in a reply
gusrbehfdl Offline
Member

Post: #6
RE: Camera Collision Question
Thanks for replies,

I made AG_ITEMS = 1,

now, how do I let esenthel know that Item actors are in AG_ITEMS?

what I mean is, how do I assign the correct group to the actors?
12-19-2010 03:40 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #7
RE: Camera Collision Question
Actor::group
12-19-2010 12:55 PM
Find all posts by this user Quote this message in a reply
gusrbehfdl Offline
Member

Post: #8
RE: Camera Collision Question
ah ha!, simple enough haha

Thanks alot
12-21-2010 02:49 AM
Find all posts by this user Quote this message in a reply
Post Reply