|
Re: Creating a move gizmo
[Re: DJBMASTER]
#289434
09/13/09 00:51
09/13/09 00:51
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
Didn't know mouse_pos3d before. Maybe, you could move an entity parallel to the view the following way:
function move_with_mouse()
{
VECTOR to;
if(mouse_left&&mouse_ent)
{
set(mouse_ent, TRANSLUCENT);
set(mouse_ent, LIGHT);
vec_diff(to, mouse_ent.x, mouse_pos3d);
vec_add(to,mouse_pos3d);
vec_set(mouse_ent.x, to);
}
}
|
|
|
Re: Creating a move gizmo
[Re: Pappenheimer]
#289438
09/13/09 01:25
09/13/09 01:25
|
Joined: Nov 2007
Posts: 1,143 United Kingdom
DJBMASTER
OP
Serious User
|
OP
Serious User
Joined: Nov 2007
Posts: 1,143
United Kingdom
|
I couldn't even get the arrow to drag when i used the code above, lol. I think i'm on to something though...
Last edited by DJBMASTER; 09/13/09 01:38.
|
|
|
Re: Creating a move gizmo
[Re: Pappenheimer]
#289548
09/13/09 22:51
09/13/09 22:51
|
Joined: Nov 2007
Posts: 1,143 United Kingdom
DJBMASTER
OP
Serious User
|
OP
Serious User
Joined: Nov 2007
Posts: 1,143
United Kingdom
|
lol, np. I have this so far and it does work, in that i can drag an arrow using the mouse...
ENTITY* x_arrow; // x direction arrow attached to entity
VECTOR to;
while(1)
{
var distance = c_trace(player.x, x_arrow.x, IGNORE_ME);
vec_set(to, mouse_dir3d);
vec_scale(to, distance);
vec_add(to, mouse_pos3d);
x_arrow.x = to.x;
wait(1);
}
...just seems a little buggy.
|
|
|
|