For any feature requests to either the Skyline Engine or the websites and forums please leave your suggestion here.

Physics API

Physics API

Postby ant0N » 18 Nov 2012, 15:34

here is how I see these commands.
over time the list of commands will be added. :D


Code: Select all
1 body.CreateBox(size)
2 body.CreateCylinder()
3 body.CreateCone()
4 body.CreateSphere(radius)
5 body.CreateTree()
6 body.CreateHull()


Code: Select all
1 body.addForce(body, Vec3, Global = 1) --If the global parameter is 0 the velocity will be set along the body's own axes
2 body.addTorque(body, Vec3, Global = 1)
3 body.addVelocity()


Code: Select all
1 body.setMass(body, float)
2 body.setGravity(body, float)
3 body.setMassCenter(body, Vec3)
4 body.setElasticity(body, float) --Set the elasticity of a body to a value between 0 and 1, 1.0 being the maximum
5 body.setSoftness(body, float)
6 body.setFriction(body, float)
7 body.setBuoyancy(body, int) --Sets a body's buoyancy mode (set this to 1 if the body should be able to float, otherwise 0)
8 body.setVelocity(body, Vec3, Global = 1) --Sets the body velocity. If the global parameter is 0 the velocity will be set along the body's own axes. This can be used to make a car move forward regardless of its orientation
9 body.setTorque(body, Vec3, Global = 1)
10 body.setForce(body, Vec3, Global = 1)


Code: Select all
1 body.getVelocity(body)
2 body.getMass(body)
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: Physics API

Postby StarFire » 18 Nov 2012, 15:57

Cool thanks ;)

these lists will help very much :D
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: Физика API

Postby ant0N » 30 Nov 2012, 14:34

CONTROLLER:
controller is the physical body, it will allow to simplify the process of creating the player and NPC.

controller.create(height, radius)
controller.update(controller,rotation,move,strafe,jump,crouch)
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller

Re: Physics API

Postby StarFire » 30 Nov 2012, 14:38

Thanks antON, we will look at these new commands soon, I am just completing our new base shader which enables directional,point and spot lights and has a much nicer normal map and lighting.
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: Physics API

Postby StarFire » 17 Dec 2012, 22:53

Just to let you know we have completed a few lua physics commands ready for the upcoming release:

  • physics.addBody(int objID, enum.body_Sphere(),int active)
  • physics.setActive(int bodyID, int state);
  • physics.setMass(int bodyID,float mass);
  • physics.setBounce(int bodyID ,float bounce);
  • physics.setFriction(int bodyID, float friction);
  • physics.setTerrainBounce(int bounce);
  • physics.setTerrainFriction(int friction);
  • physics.setGravity(float x, float y, float z);
  • physics.setVelocity(int bodyID, float x, float y, float z);
  • x,y,z = physics.getGravity();
  • float bounce= physics.getBounce(int bodyID);
  • float friction= physics.getFriction(int bodyID);
  • float mass= physics.getMass(int bodyID);
  • enum.body_Cube();
  • enum.body_Sphere();
  • enum.body_Capsule();
  • enum.body_PlayerCapsule();
  • enum.body_ConvexHull();
  • enum.body_MeshHull();

I am going see if we can get the angular movement for characters next ;)
User avatar
StarFire
Skyline Founder
Skyline Founder
 
Posts: 1678
Joined: 03 Jan 2012, 18:50
Location: UK
Skill: Great creative
Skill: Programmer
Skill: 3D Modeller
Skill: 2D Artist
Skill: Level Designer

Re: Physics API

Postby ant0N » 18 Dec 2012, 03:13

thank you, NightHawk! Continue in the same spirit... the more teams we have, the better. ;)
User avatar
ant0N
Skyline Moderator
Skyline Moderator
 
Posts: 415
Joined: 02 Nov 2012, 12:49
Location: Россия, Москва
Skill: Programmer
Skill: 3D Modeller


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 6 guests