A VPhysics environment within which objects are simulated. New IPhysicsObjects are created here, and global settings like gravity can be configured.
IPhysicsEnvironment* physenv is created by default. Multiple environments are entirely possible, which is how Portal and Portal 2 work.
I don't see anything that states this is only a part of Portal and Portal 2, so I am inclined to believe this is possible. Could we get some methods to create/destroy physics environments and move physics objects between them? Adding this would result in better lua-based portals/"bigger on the inside" effects (since it seems adding linked_portal_door) isn't happening due to limitations).
More Details
Was thinking something like this;
local physenv = physenv.CreateEnvironment()
physenv:Destroy()
A PhysicsEnvironment could have most of the methods that the physenv library have, except as self-calling functions, ie.
As to add physics objects to the physics environment, I don't know how that works under the hood (can physics objects be in multiple physics environments, etc...)
Potential problems??
What to do when a physics environment is destroyed with physics objects in it? Just push them back to the main physics environment if they are no longer a part of any sub-environment?
The use cases I provided would be ones where the world is not a part of the physics object; is there a good way to have support for both including the world and not including the world? Not needed, but maybe someone would want a separate physics environment but still have world collision for whatever reason
Players in different physics objects?
Can this be done both clientside and serverside in a nice way to be seamless?
Details
According to the VPhysics page on the Valve Developer Wiki, multiple IPhysicsEnvironments are possible.
I don't see anything that states this is only a part of Portal and Portal 2, so I am inclined to believe this is possible. Could we get some methods to create/destroy physics environments and move physics objects between them? Adding this would result in better lua-based portals/"bigger on the inside" effects (since it seems adding linked_portal_door) isn't happening due to limitations).
More Details
Was thinking something like this;
A PhysicsEnvironment could have most of the methods that the physenv library have, except as self-calling functions, ie.
As to add physics objects to the physics environment, I don't know how that works under the hood (can physics objects be in multiple physics environments, etc...)
Potential problems??