Jetro
Member
|
Some question
1.Can I use PhysHit in GuiViewport?
2. Can i pick object by poly?
3. How to make grid?
|
|
02-21-2010 07:27 AM |
|
Esenthel
Administrator
|
RE: Some question
1. yes
activate the viewport before using collision detection
3. draw lines
|
|
02-22-2010 04:48 PM |
|
Jetro
Member
|
RE: Some question
Not work Physhit at GuiViewport. Here's the code:
Code:
Camera *cam=NULL; // start with none
if(Gui.viewport==&viewport[0])
{
cam=&camera[0];
Gui.viewport->activate();
if(Ms.b(1)) // only when mouse button pressed
{
cam->yaw -=Ms.d.x;
cam->pitch+=Ms.d.y;
}
if(Ms.wheel()<0)cam->dist*=1.2;
if(Ms.wheel()>0)cam->dist/=1.2;
cam->setSpherical();
if(Ms.b(0))
{
Vec screen_pos,
screen_dir;
ScreenToPosDir(Ms.pos, screen_pos, screen_dir);
Vec start=screen_pos,
end =screen_pos + screen_dir*75;
PhysHit phys_hit;
if(Physics.ray(start,end-start,&phys_hit))
{
StateExit.set();
}
else
{
}
}
|
|
02-23-2010 08:59 AM |
|
Esenthel
Administrator
|
RE: Some question
Gui.viewport->activate();
I meant the Viewport (not GuiViewport object) :
gui_viewport.viewport.set..
cam->setSpherical().set();
|
|
02-23-2010 04:36 PM |
|
Jetro
Member
|
RE: Some question
Thank you! Now everything works!
And what about "2. Can i pick object by poly?"
(This post was last modified: 02-23-2010 05:29 PM by Jetro.)
|
|
02-23-2010 05:27 PM |
|
Esenthel
Administrator
|
RE: Some question
please be more specific - what you want to do
|
|
02-24-2010 12:33 AM |
|
Jetro
Member
|
RE: Some question
I want to make a map editor for Action game. And I want to could be pick cube by poly and a separate poly could applied a texture.
|
|
02-24-2010 04:06 PM |
|
Jetro
Member
|
RE: Some question
How to use func mesh.Draw2d()?
|
|
02-25-2010 04:14 PM |
|