Adam's Lair Forum

game development and casual madness
It is currently 2017/02/24, 17:13

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 2017/02/17, 07:17 
Junior Member
Junior Member
User avatar

Joined: 2017/02/09, 19:26
Posts: 25
Role: Hobbyist
A complex body plugin (arbitrary-sized, non-convex and editable RigidBody).
Warning: This is WIP. Really.
Gfycat Video - Click to Play. [Source]
It works, but...
1. If you change the position, the scale or the rotation of the ComplexBody object, weird things happen when editing the body. The XYZ transformation is not right.
2. The texture management is as far from good as it can be. I'm thinking of rotating each triangle texture based on the rotation of the previous triangle, but first I wanted to finish the editor plugin, and I'm loosing my mind :lol:
3. The vertex sort order could be modified to something better.
4. The code should be cleaner.

How it works:
To edit a ComplexBody it must be selected (green lines) AFTER entering the ComplexBody Editor.
Left click to move or add a vertice.
Right click to remove a vertice.
Ctrl to show the snap lines.
When a vertex is added, it is ordered based on the proximity of the other vertices.

Here is the code: https://github.com/YMRYMR/YMR.ComplexBody

You are welcome to try it and help (or change everything) ;)

PS: The ear cutting triangulation code is the work of fgshen, and the correction code is the work of gomezmateu.oscar. They did the real magic.


Top
 Profile  
 
PostPosted: 2017/02/17, 18:44 
Forum Adept
Forum Adept

Joined: 2015/07/08, 16:41
Posts: 414
Role: Gamer
Editing looks really smooth, even in the current WIP state. This might help a lot in level prototyping situations. Nice work!


Top
 Profile  
 
PostPosted: 2017/02/17, 18:55 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 1924
Location: Germany
Role: Professional
Heh, so you already took the editor development deep dive! Nice work :) :1+:

Have you considered letting the complex shape editor do the shape drawing, rather than the object itself? (I'm guessing it's the object, because you can initially see the vertex numbers in Game View mode)

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2017/02/17, 19:08 
Junior Member
Junior Member
User avatar

Joined: 2017/02/09, 19:26
Posts: 25
Role: Hobbyist
Thanks!

Adam wrote:
Have you considered letting the complex shape editor do the shape drawing, rather than the object itself?
I thought about it, but not sure how to avoid duplicating the drawing code. I've modified the code to be able to work in the editor, but it is 100% game code with little bits for the CamViewState.


Top
 Profile  
 
PostPosted: 2017/02/23, 06:16 
Junior Member
Junior Member
User avatar

Joined: 2017/02/09, 19:26
Posts: 25
Role: Hobbyist
Thanks to @Adam's help, the texture rendering is working now xD
Gfycat Video - Click to Play. [Source]
Code commited to GitHub.

The only issue I can think of right now is that the algorithm isn't perfect: When you have a descompensated shape (say W = 1.000,00 and H = 1,00), it could result in an incorrect triangulation.
Anyway, or my current purposes it works, so [for now] I'll end the development of this plugin. But of course, feedback is always welcome.


Top
 Profile  
 
PostPosted: 2017/02/23, 09:07 
Veteran Member
Veteran Member
User avatar

Joined: 2015/10/04, 15:48
Posts: 153
Location: Germany
Role: Hobbyist
@YMR:

Looks great! :) I'll test your plugin when I'm back home ^^

_________________
Twitter | GitHub | Join Duality on Discord | itch.io


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group