![Neutral :|](./images/smilies/ms-unplzd.png)
The physics engine can't do line or "edge" shapes, can it
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
The physics engine can't do line or "edge" shapes, can it
Because that would be too bad. It would make something I'm trying to do easier. ![Neutral :|](./images/smilies/ms-unplzd.png)
![Neutral :|](./images/smilies/ms-unplzd.png)
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: The physics engine can't do line or "edge" shapes, can i
It can do rectangular shapes. I don't know the side minimal length, but it should not be very big.
When I write def I mean function.
Re: The physics engine can't do line or "edge" shapes, can i
I did a quick test and the narrowest I could make a rectangle is 6 pixels (meter is set to 64 pixels). That might be a bit high in a world made of 64x64 tiles. These edge bodies are going to lie between tiles you see.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: The physics engine can't do line or "edge" shapes, can i
If you really, really want to do those "edges", then you could just do everything else 6 times bigger and zoom out x6 times.
But I recommend you to reconsider.
What so you need those "edges" for? Maybe there's a cleaner way too do what you want.
But I recommend you to reconsider.
What so you need those "edges" for? Maybe there's a cleaner way too do what you want.
When I write def I mean function.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: The physics engine can't do line or "edge" shapes, can i
And it uses surface, so a 6x6 square could also be a 1x36 'line'.
Re: The physics engine can't do line or "edge" shapes, can i
So it has to have a minimum surface area? Weird.bartbes wrote:And it uses surface, so a 6x6 square could also be a 1x36 'line'.
If I was writing it, I would have just made sure you can't make negative shapes.
![Razz :P](./images/smilies/ms-razz.png)
Well... Those can be used to make traps/black holes, so I'd leave it be.
Hello, I am not dead.
Re: The physics engine can't do line or "edge" shapes, can i
As I mentioned, this is for a tile based game. I want something that acts like a zero-width wall between tiles, such that you can't enter one tile when crossing over from the other tile. I'm leery of a 6-or-whatever pixel width rectangle that lies on the edge because it would jut out from the true edge. I want it so that when there's an edge wall between two tiles, one tile acts like a whole wall when you're on one side, while when you're on the other side it's the other tile that acts like a wall. Does that make sense?kikito wrote:What so you need those "edges" for? Maybe there's a cleaner way too do what you want.
Huh?bartbes wrote:And it uses surface, so a 6x6 square could also be a 1x36 'line'.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: The physics engine can't do line or "edge" shapes, can i
How about using setMask for that?VideroBoy wrote:I want something that acts like a zero-width wall between tiles, such that you can't enter one tile when crossing over from the other tile. I'm leery of a 6-or-whatever pixel width rectangle that lies on the edge because it would jut out from the true edge. I want it so that when there's an edge wall between two tiles, one tile acts like a whole wall when you're on one side, while when you're on the other side it's the other tile that acts like a wall. Does that make sense?
You would have to be a bit proactive about correctly setting up your player's masks on any given time, though.
When I write def I mean function.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: The physics engine can't do line or "edge" shapes, can i
Box2D isn't too big on tile-based games. In the long run, it might be simpler to do without it.
Using setMask would probably be better, though, if you're going to stick to Box2D.
bartbes means that if you stretch a polygon shape so it has the right area, but is thin enough not to be noticeably wider than 0.VideroBoy wrote:Huh?bartbes wrote:And it uses surface, so a 6x6 square could also be a 1x36 'line'.
Using setMask would probably be better, though, if you're going to stick to Box2D.
Help us help you: attach a .love.
Who is online
Users browsing this forum: No registered users and 5 guests