The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 2 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simulating changes in gravity
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#1
Simulating changes in gravity

I was messing around with repeated prop forces when I discovered a way to easily simulate changing gravity on an object. Objects with reversed gravity will "fall" upward seamlessly, bouncing and rolling on the ceiling like they normally would on the floor. You can also still grab objects and throw them around, and I had a lot of fun lodging books on the undersides of tables.

AddTimer("AntiGravity", 0.0f, "AntiGravity");

void AntiGravity(string & asTimer)
{
AddPropForce("[ENTITY]", 0, F, 0, "world");
AddTimer(asTimer, 0.01f, "AntiGravity");
}

Formula for calculating Prop Force
M = Mass of Object
G = Gravity Multiplier (2 = double, 1 = normal, 0 = no gravity, -1 = reversed)

F = (1-G) x 9.81M

(Also, forgive me for being a nerd, but since the formula pretty much came out to be Newton's second law, that leads me to believe the game technically uses kg for it's mass units, and Newtons for it's PropForce units. Cool little tidbit.)





(This post was last modified: 04-06-2012, 04:33 AM by Damascus.)
04-02-2012, 09:07 PM
Find


Messages In This Thread
Simulating changes in gravity - by Damascus - 04-02-2012, 09:07 PM
RE: Simulating changes in gravity - by Adrianis - 04-02-2012, 10:11 PM
RE: Simulating changes in gravity - by Damascus - 04-03-2012, 12:00 AM
RE: Simulating changes in gravity - by Adrianis - 04-03-2012, 03:26 PM
RE: Simulating changes in gravity - by Homicide13 - 04-05-2012, 10:28 AM
RE: Simulating changes in gravity - by Adrianis - 04-05-2012, 12:03 PM
RE: Simulating changes in gravity - by Kman - 04-05-2012, 10:56 AM
RE: Simulating changes in gravity - by Damascus - 04-06-2012, 01:01 AM
RE: Simulating changes in gravity - by Homicide13 - 04-05-2012, 09:35 PM
RE: Simulating changes in gravity - by Adrianis - 04-05-2012, 09:45 PM
RE: Simulating changes in gravity - by Adrianis - 05-21-2012, 12:21 AM
RE: Simulating changes in gravity - by Damascus - 04-06-2012, 04:34 AM
RE: Simulating changes in gravity - by Adrianis - 04-08-2012, 10:13 PM
RE: Simulating changes in gravity - by Damascus - 04-08-2012, 11:09 PM
RE: Simulating changes in gravity - by DRedshot - 04-15-2012, 03:00 PM
RE: Simulating changes in gravity - by Adrianis - 04-15-2012, 05:18 PM
RE: Simulating changes in gravity - by Damascus - 04-16-2012, 06:37 AM
RE: Simulating changes in gravity - by Damascus - 05-11-2012, 07:26 AM



Users browsing this thread: 1 Guest(s)