summaryrefslogtreecommitdiff
path: root/legacy/ephysics/doc
diff options
context:
space:
mode:
authorRicardo de Almeida Gonzaga <ricardo@profusion.mobi>2012-09-14 22:04:31 +0000
committerBruno Dilly <bdilly@profusion.mobi>2012-09-14 22:04:31 +0000
commit7ae00ec501272d4638e4eae33b69c7b2ec905ad4 (patch)
tree65b019402729275f0a8c0bf3cd7de6cac0742136 /legacy/ephysics/doc
parentead58d536e7b1cf0982b753ad18ca44e7b854809 (diff)
ephysics: add a new example doc: Collision Detection -
test_collision_detection.c Patch by: Ricardo de Almeida Gonzaga <ricardo@profusion.mobi> SVN revision: 76693
Diffstat (limited to 'legacy/ephysics/doc')
-rw-r--r--legacy/ephysics/doc/examples.dox94
1 files changed, 94 insertions, 0 deletions
diff --git a/legacy/ephysics/doc/examples.dox b/legacy/ephysics/doc/examples.dox
index 70cf74a3dc..be6df3647b 100644
--- a/legacy/ephysics/doc/examples.dox
+++ b/legacy/ephysics/doc/examples.dox
@@ -5,6 +5,7 @@
5 * 5 *
6 * @li @ref tutorial_ephysics_bouncing_ball 6 * @li @ref tutorial_ephysics_bouncing_ball
7 * @li @ref tutorial_ephysics_bouncing_text 7 * @li @ref tutorial_ephysics_bouncing_text
8 * @li @ref tutorial_ephysics_collision_detection
8 * @li @ref tutorial_ephysics_delete_body 9 * @li @ref tutorial_ephysics_delete_body
9 * @li @ref tutorial_ephysics_constraint 10 * @li @ref tutorial_ephysics_constraint
10 */ 11 */
@@ -281,6 +282,99 @@
281 */ 282 */
282 283
283/** 284/**
285 * @page tutorial_ephysics_collision_detection EPhysics - Collision Detection
286 *
287 * The purpose of this example is to demonstrate the EPhysics Collision
288 * Detection usage - The code adds two balls, one with impulse and the second
289 * with a collision detection callback, to show an effect.
290 *
291 * For this example we'll have an EPhysics_World, and two basic EPhysics_Bodys,
292 * we'll apply an impulse in one of then and the other will be stopped
293 * "waiting" for a collision.
294 *
295 * The basic concepts like - initializing an EPhysics_World, render geometry,
296 * physics limiting boundaries, add an Ephysics_Body, associate it to evas
297 * objects, change restitution, friction and impulse properties, were
298 * already covered in
299 * @ref tutorial_ephysics_bouncing_ball
300 *
301 * @section add-collstruct Collision Data Struct
302 * @dontinclude test_collision_detection.c
303 *
304 * While in this example we'll be working with a struct to hold some objects
305 * in our code. For clarity sake we present you the struct declaration in the
306 * following block.
307 *
308 * @skip struct _Collision_Data {
309 * @until };
310 *
311 * @section add-callbacks Adding the Callback
312 *
313 * Calling ephysics_body_event_callback_add()
314 * will register a callback to a type of physics body event.
315 *
316 * @ref EPHYSICS_CALLBACK_BODY_COLLISION : called just after the collision has
317 * been actually processed by the physics engine. In other words, to be
318 * notified about a collision between two physical bodies.
319 *
320 * @skip ephysics_body_event_callback_add(collision_data->sphere
321 * @until );
322 *
323 * See
324 * @ref _EPhysics_Callback_Body_Type
325 * for more event types.
326 *
327 * @section add-collcb Collision Function
328 *
329 * The callback function will filter the collision to be sure if that body is
330 * which we want and then show the effect.
331 *
332 * First we need to create a specific variable type to get collision infos:
333 * @ref EPhysics_Body_Collision
334 *
335 * @dontinclude test_collision_detection.c
336 *
337 * @skip _collision_cb
338 * @until int x, y;
339 *
340 * Now we want to know which body collides with and filter it.
341 *
342 * @skip contact_body =
343 * @until return;
344 *
345 * We just get the collision position, move the impact effect to this
346 * coordinate and send a signal to edje to show it.
347 *
348 * @skip ephysics_body_collision_position_get
349 * @until "ephysics_test");
350 * @skipline }
351 *
352 * Here we finish the example. The full source code can be found at
353 * @ref test_collision_detection_c.
354 *
355 */
356
357 /**
358 * @page test_collision_detection_c test_collision_detection.c
359 *
360 * @section ephysics-test-h ephysics_test.h
361 * @include ephysics_test.h
362 *
363 * @section test-collision_detection-c test_collision_detection.c
364 * @dontinclude test.c
365 *
366 * @skip test_clean
367 * @until }
368 *
369 * @skip test_win_add
370 * @until }
371 *
372 * @include test_collision_detection.c
373 *
374 * @example test_collision_detection.c
375 */
376
377/**
284 * @page tutorial_ephysics_delete_body EPhysics - Delete Body 378 * @page tutorial_ephysics_delete_body EPhysics - Delete Body
285 * 379 *
286 * The purpose of this example is to demonstrate the EPhysics Callbacks usage - 380 * The purpose of this example is to demonstrate the EPhysics Callbacks usage -