• Create Account

### #ActualNathanFR

Posted 05 November 2012 - 07:29 AM

It seems to be a basic collision-detection problematic. It's a really wide subject and it's really depends on what are your requirements, what do you want to achieve and what tools are you using?
Basically , the first part of a collision-detection process is of couse detect if a pair of entities are actually overlapping. But here again it really depends of what you want to achieve (give us more informations about that), there are dozen of ways/algorithms to do it. Generally, this part of the process is divided in two parts:
• The Broad-Phase. Here is a great tutorial that expose a way to go: http://www.metanetso.../tutorialB.html. Basically in this phase, your goal is to quickly find all the entities that would eventually collide with the entity you are currently proceeding. There is no overlap test here.
• The Narrow-Phase: Once you know all the entities that would potentially overlap your current entity, you have to do the actual collision test against the current entity and all the potentially overlapping entities. For this part, refer to the Bacterius post and to this tutorial http://www.metanetso.../tutorialA.html.

The algorithm could be something like:

function collisionDetection(Entity currentEntity) {
collidableEntities = doBroadPhase(currentEntity) //collidableEntities here could be a list of potentially overlapping entities
foreach ( ce : collidableEntities) {
if (doNarrowPhase(currentEntity, ce)) {
//the current entity is overlapping this entity
//do something
}
}

//and once per frame in your game loop
foreach (e : entities) {//entities is here all your entities
collisionDetection(e)
}
}


### #9NathanFR

Posted 05 November 2012 - 07:28 AM

It seems to be a basic collision-detection problematic. It's a really wide subject and it's really depends on what are your requirements, what do you want to achieve and what tools are you using?
Basically , the first part of a collision-detection process is of couse detect if a pair of entities are actually overlapping. But here again it really depends of what you want to achieve (give us more informations about that), there are dozen of ways/algorithms to do it. Generally, this part of the process is divided in two parts:

• The Broad-Phase. Here is a great tutorial that expose a way to go: http://www.metanetso.../tutorialB.html. Basically in this phase, your goal is to quickly find all the entities that would eventually collide with the entity you are currently proceeding. There is no overlap test here.
• The Narrow-Phase: Once you know all the entities that would potentially overlap your current entity, you have to do the actual collision test against the current entity and all the potentially overlapping entities. For this part, refer to the Bacterius post and to this tutorial http://www.metanetso.../tutorialA.html.
The algorithm could be something like:

function collisionDetection(Entity currentEntity) {
collidableEntities = doBroadPhase(currentEntity) //collidableEntities here could be a list of potentially overlapping entities
foreach ( ce : collidableEntities) {
if (doNarrowPhase(currentEntity, ce)) {
//the current entity is overlapping this entity
//do something
}
}

//and once per frame in your game loop
foreach (e : entities) {//entities is here all your entities
collisionDetection(e)
}
}


### #8NathanFR

Posted 05 November 2012 - 07:28 AM

It seems to be a basic collision-detection problematic. It's a really wide subject and it's really depends on what are your requirements, what do you want to achieve and what tools are you using?
Basically , the first part of a collision-detection process is of couse detect if a pair of entities are actually overlapping. But here again it really depends of what you want to achieve (give us more informations about that), there are dozen of ways/algorithms to do it. Generally, this part of the process is divided in two parts:
• The Broad-Phase. Here is a great tutorial that expose a way to go: http://www.metanetso.../tutorialB.html. Basically in this phase, your goal is to quickly find all the entities that would eventually collide with the entity you are currently proceeding. There is no overlap test here.
• The Narrow-Phase: Once you know all the entities that would potentially overlap your current entity, you have to do the actual collision test against the current entity and all the potentially overlapping entities. For this part, refer to the Bacterius post and to this tutorial http://www.metanetso.../tutorialA.html.

The algorithm could be something like:

function collisionDetection(Entity currentEntity) {
collidableEntities = doBroadPhase(currentEntity) //collidableEntities here could be a list of potentially overlapping entities
foreach ( ce : collidableEntities) {
if (doNarrowPhase(currentEntity, ce)) {
//the current entity is overlapping this entity
//do something
}
}

//and once per frame in your game loop
foreach (e : entities) {//entities is here all your entities
collisionDetection(e)
}
}


### #7NathanFR

Posted 05 November 2012 - 07:28 AM

It seems to be a basic collision-detection problematic. It's a really wide subject and it's really depends on what are your requirements, what do you want to achieve and what tools are you using?
Basically , the first part of a collision-detection process is of couse detect if a pair of entities are actually overlapping. But here again it really depends of what you want to achieve (give us more informations about that), there are dozen of ways/algorithms to do it. Generally, this part of the process is divided in two parts:
• The Broad-Phase. Here is a great tutorial that expose a way to go: http://www.metanetso.../tutorialB.html. Basically in this phase, your goal is to quickly find all the entities that would eventually collide with the entity you are currently proceeding. There is no overlap test here.
• The Narrow-Phase: Once you know all the entities that would potentially overlap your current entity, you have to do the actual collision test against the current entity and all the potentially overlapping entities. For this part, refer to the Bacterius post and to this tutorial http://www.metanetso.../tutorialA.html.
The algorithm could be something like:

function collisionDetection(Entity currentEntity) {
collidableEntities = doBroadPhase(currentEntity) //collidableEntities here could be a list of potentially overlapping entities
foreach ( ce : collidableEntities) {
if (doNarrowPhase(currentEntity, ce)) {
//the current entity is overlapping this entity
//do something
}
}

//and once per frame in your game loop
foreach (e : entities) {//entities is here all your entities
collisionDetection(e)
}
}


### #6NathanFR

Posted 05 November 2012 - 07:27 AM

It seems to be a basic collision-detection problematic. It's a really wide subject and it's really depends on what are your requirements, what do you want to achieve and what tools are you using?
Basically , the first part of a collision-detection process is of couse detect if a pair of entities are actually overlapping. But here again it really depends of what you want to achieve (give us more informations about that), there are dozen of ways/algorithms to do it. Generally, this part of the process is divided in two parts:
• The Broad-Phase. Here is a great tutorial that expose a way to go: http://www.metanetso.../tutorialB.html. Basically in this phase, your goal is to quickly find all the entities that would eventually collide with the entity you are currently proceeding. There is no overlap test here.
• The Narrow-Phase: Once you know all the entities that would potentially overlap your current entity, you have to do the actual collision test against the current entity and all the potentially overlapping entities. For this part, refer to the Bacterius post and to this tutorial http://www.metanetsoftware.com/technique/tutorialA.html.
The algorithm could be something like:

function collisionDetection(Entity currentEntity) {
collidableEntities = doBroadPhase(currentEntity) //collidableEntities here could be a list of potentially overlapping entities
foreach ( ce : collidableEntities) {
if (doNarrowPhase(currentEntity, ce)) {
//the current entity is overlapping this entity
//do something
}
}

//and once per frame in your game loop
foreach (e : entities) {//entities is here all your entities
collisionDetection(e)
}
}


### #5NathanFR

Posted 05 November 2012 - 07:26 AM

It seems to be a basic collision-detection problematic. It's a really wide subject and it's really depends on what are your requirements, what do you want to achieve and what tools are you using?
Basically , the first part of a collision-detection process is of couse detect if a pair of entities are actually overlapping. But here again it really depends of what you want to achieve (give us more informations about that), there are dozen of ways/algorithms to do it. Generally, this part of the process is divided in two parts:
• The Broad-Phase. Here is a great tutorial that expose a way to go: http://www.metanetso.../tutorialB.html. Basically in this phase, your goal is to quickly find all the entities that would eventually collide with the entity you are currently proceeding. There is no overlap test here.
• The Narrow-Phase: Once you know all the entities that would potentially overlap your current entity, you have to do the actual collision test against the current entity and all the potentially overlapping entities. For this part, refer to the Bacterius post.
The algorithm could be something like:

function collisionDetection(Entity currentEntity) {
collidableEntities = doBroadPhase(currentEntity) //collidableEntities here could be a list of potentially overlapping entities
foreach ( ce : collidableEntities) {
if (doNarrowPhase(currentEntity, ce)) {
//the current entity is overlapping this entity
//do something
}
}

//and once per frame in your game loop
foreach (e : entities) {//entities is here all your entities
collisionDetection(e)
}
}


PARTNERS