Forum

Restoring or Adding Physics to MOVETYPE_TOSS

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Restoring or Adding Physics to MOVETYPE_TOSS

Postby Ghost_Fang » Mon Jan 09, 2012 8:54 pm

Basically, I got a primitive gravity gun that picks up an object by setting the picked up object's origin to the end of my traceline every frame. When let go the object floated in mid air, I sort of fixed this by adding droptofloor, but theres no visual falling going on and I'd like to see that. So how would i start (or restart) the physics of an object with MOVETYPE_TOSS to make it fall when it's let go.
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am

Re: Restoring or Adding Physics to MOVETYPE_TOSS

Postby frag.machine » Mon Jan 09, 2012 11:59 pm

Untested, but I'd try this after changing to MOVETYPE_TOSS:
Code: Select all
obj.velocity = '0 0 1';
obj.flags = obj.flags - (obj.flags & FL_ONGROUND);
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Re: Restoring or Adding Physics to MOVETYPE_TOSS

Postby Ghost_Fang » Tue Jan 10, 2012 12:08 am

Thanks, it did work, but I have messed with it some more and decided to spawn a complete copy of the object and that allows for physics to take place. It wasn't that urgent, it was a proof of concept really, thanks for the help though :)
Ghost_Fang
 
Posts: 336
Joined: Thu Nov 12, 2009 4:37 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest