Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AbrahamR, wdlmaster, 7th_zorro, dr_panther, 1 invisible), 764 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Object without gravity #166101
11/06/07 09:26
11/06/07 09:26
Joined: Mar 2005
Posts: 12
R
Richey Offline OP
Newbie
Richey  Offline OP
Newbie
R

Joined: Mar 2005
Posts: 12
Is it possible to gave a physics object that is not affected by gravity?

I'd like to implement a object that is controlled by mouse movement and the movement of that object to affect other physics objects. Like a bat controlled by the player hitting a ball.

I hoped to do this with phent_addcentralforce and setting the mass to 0 but with the mass set phent_addcentral force does not seem to apply. If I don't set mass then the object falls to the gound.

Re: Object without gravity [Re: Richey] #166102
11/10/07 07:41
11/10/07 07:41
Joined: Mar 2007
Posts: 677
0x00000USA
M
MrCode Offline
User
MrCode  Offline
User
M

Joined: Mar 2007
Posts: 677
0x00000USA
I actually find that an entity with just a c_setminmax works fine. The entity shoves into the physics object a little, but it does interact properly.

I came up with this "3D Cursor" concept for a project that I'm working on:

Code:


ENTITY* cur_ent;
BMAP* cur= "rcursor.pcx";

void curent()
{
cur_ent= me;
c_setminmax(me);
my.scale_x= 0.25;
my.scale_y= 0.25;
my.scale_z= 0.25;
while(1)
{
my.pan= camera.pan - 90;
my.tilt= camera.roll;
my.roll= camera.tilt;
mouse_dist+= mickey.z * 0.1;
vec_set(curpos,vector(mouse_cursor.x,mouse_cursor.y,mouse_dist + 50));
vec_for_screen(curpos,camera);
cur_ent.x= curpos.x;
cur_ent.y= curpos.y;
cur_ent.z= curpos.z;
wait(1);
}
}

and a function for switching between 2D and 3D mouse cursors:

void _3dcur_toggle()
{
if(cur_mode== 1)
{
if(mouse_ent== cur_ent)
{
ent_remove(cur_ent);
snd_play(toggle_,100,0);
spawn_mode= 0;
}
else
{
cur_mode= 0;
}
mouse_map= cur;
mouse_dist= 0;
wait(3);
}
if(cur_mode== 0)
{
snd_play(toggle_,100,0);
ent_create("cur.mdl",nullvector,curent);
cur_mode= 1;
spawn_mode= 1;
mouse_map= NULL;
}
}



You may want to change the images, the model, and the camera synchronization calculations (my "cur.mdl" is oriented incorrectly in MED). Other than that, good luck!

Hope this helps


Code:
void main()
{
    cout << "I am MrCode,";
    cout << "hear me roar!";
    system("PAUSE");
}

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1