[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-physics / third-party / chipmunk2d / include / chipmunk / cpHastySpace.h
1 // Copyright 2013 Howling Moon Software. All rights reserved.
2 // See http://chipmunk2d.net/legal.php for more information.
3
4 /// cpHastySpace is exclusive to Chipmunk Pro
5 /// Currently it enables ARM NEON optimizations in the solver, but in the future will include other optimizations such as
6 /// a multi-threaded solver and multi-threaded collision broadphases.
7
8 struct cpHastySpace;
9 typedef struct cpHastySpace cpHastySpace;
10
11 /// Create a new hasty space.
12 /// On ARM platforms that support NEON, this will enable the vectorized solver.
13 /// cpHastySpace also supports multiple threads, but runs single threaded by default for determinism.
14 CP_EXPORT cpSpace *cpHastySpaceNew(void);
15 CP_EXPORT void cpHastySpaceFree(cpSpace *space);
16
17 /// Set the number of threads to use for the solver.
18 /// Currently Chipmunk is limited to 2 threads as using more generally provides very minimal performance gains.
19 /// Passing 0 as the thread count on iOS or OS X will cause Chipmunk to automatically detect the number of threads it should use.
20 /// On other platforms passing 0 for the thread count will set 1 thread.
21 CP_EXPORT void cpHastySpaceSetThreads(cpSpace *space, unsigned long threads);
22
23 /// Returns the number of threads the solver is using to run.
24 CP_EXPORT unsigned long cpHastySpaceGetThreads(cpSpace *space);
25
26 /// When stepping a hasty space, you must use this function.
27 CP_EXPORT void cpHastySpaceStep(cpSpace *space, cpFloat dt);