Jump to content

phy-files


VeTaL
 Share

Recommended Posts

you just have to play around with the setting until you get something you like... so create a box phy file using phygen and set the Scale up with setting like 1,20,1... or whatever until it approximates the size of your model

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

but position, rotation and scale fields are not editable.

 

yeah they are... collision type set to box... and i am able to change all of the other settings...

 

here's one i just made that has the Yposition offset +10 and the Yscale set at 20...

 

you will need to have Show Physics on in the editor to see it..

 

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

same here position, rotation and scale fields work.

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

yeah... thats because you are not trying to load an OBJ file to create your PHY file but make a PHY file based on primitive shapes...

 

set the collision type to box then set all of your settings for position, rotation, scale... then hit the OK button and a dialog window will open up and let you save the phy file to whatever name you want...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

well you can always eyeball it in the editor with the grid on... or just play around with it... a value of 1 in the position or scale setting is equal to 1 meter in the LE editor... or if you can tell your dimensions in your modeling app, then use those... like i said its something that you have to play around with... it would be nice though if the Editor had grids available for the XY and YZ planes so you could easily see the dimensions based on the grids

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

yeah it could probably be done but seems a bit overkill when you can quickly and easily test different PHY bodies from phygen with Show Physics in the editor... granted it would help that the Editor didnt have to be stopped and restarted between different PHY files...

 

worse case you could always just write a small program that lets you load a model and it gives you the bounding box information to use in phygen...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

well the phygen code is available in older sdk's... like i said you could always write your own app... one that loads the model, determines the bounding box data and convert it to appropriate values, then save the phy file from there... something like that might be useful to the community.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

I see no reason for not using convexs everywhere. If need be, make your .obj a plain box the size you want it.

 

Using raw newton, it's much easier to write a helper function to create: Convex hulls, compound collision, and tree collision and then never bother with the primitives. The primitives are more trouble than they are worth, since you can create them out of convex hulls anyway.

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

//I see no reason for not using convexs everywhere.

Why? Wouldnt it be more hard for Newton? As i have middle-age wall in box and convex - in convex there are a lot of useless vertices.

 

I just do as you reccomend: i enable physics debug in editor, generate new phy-file from box and see what i get in editor by adding model.

Working on LeaFAQ :)

Link to comment
Share on other sites

Again problems... What a bad day...

 

I load level with that towers

TEntity scene=LoadScene(_SCENE_FILE_NAME_);
EntityType(scene, 1);

enable collisions

Collisions(1,1,1);
Collisions(1,0,1);
Collisions(0,1,1); // just for sure

load player and set Type for him

_player = CreateController(1.8,0.4,0.5,45.01);
EntityType(_player,1);
SetBodyDamping(_player,0.0);
SetBodyMass(_player,1);

 

but still dont have collisions with walls...

 

//That way I never make any collision shapes in code.

Why not: you know parameters of the BBox, so you can create the same box in code.

 

Btw, it would be nice to load phy-files.

post-648-028296000 1282983807_thumb.jpg

Working on LeaFAQ :)

Link to comment
Share on other sites

try it without the Collisions(1,0,1) and the Collisions(0,1,1)... There is no collisiontype zero. (Well there is... but it means whatever is set to that doesn't have a collision type)

 

and you can load PHY files... LoadBody()

 

but as long as the PHY file has the exact same name as the model it will automatically load...

 

if none of that works, you could always just set the collisiontype via the lua object script then you wouldn't have to set the scene's collisiontype... also in LE, I believe controllers are usually collisiontype 3 (COLLISION_CHARACTER)...

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

//try it without the Collisions(1,0,1) and the Collisions(0,1,1)... There is no collisiontype zero.

I tried, but result is the same.

 

//but as long as the PHY file has the exact same name as the model it will automatically load...

Yep, even more: as i change phy files, i can see another shape in physic debug, so they may be loaded correctly.

 

//For bodies to collide they need to be inside the world (link)

But character collides with terrain, so collisions may work.

 

//also in LE, I believe controllers are usually collisiontype 3 (COLLISION_CHARACTER)...

Changed to

EntityType(_player,3);

and

Collisions(1,3,1);

Collisions(3,1,1);

 

Still the same

Working on LeaFAQ :)

Link to comment
Share on other sites

are you using lua scripts with your program? just curious... because if you are then there's no reason to set the collisions or set the scene's collisiontype in the program because it should automatically load the collisions.lua file... dunno...

 

just out of curiosity, can you load the scene in the editor and run the fpscontroller game script and have collision with the walls?

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...