1 /* Copyright (c) 2013 Scott Lembcke and Howling Moon Software
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 /* This header defines a number of "unsafe" operations on Chipmunk objects.
23 * In this case "unsafe" is referring to operations which may reduce the
24 * physical accuracy or numerical stability of the simulation, but will not
27 * The prime example is mutating collision shapes. Chipmunk does not support
28 * this directly. Mutating shapes using this API will caused objects in contact
29 * to be pushed apart using Chipmunk's overlap solver, but not using real
30 * persistent velocities. Probably not what you meant, but perhaps close enough.
33 /// @defgroup unsafe Chipmunk Unsafe Shape Operations
34 /// These functions are used for mutating collision shapes.
35 /// Chipmunk does not have any way to get velocity information on changing shapes,
36 /// so the results will be unrealistic. You must explicity include the chipmunk_unsafe.h header to use them.
39 #ifndef CHIPMUNK_UNSAFE_H
40 #define CHIPMUNK_UNSAFE_H
46 /// Set the radius of a circle shape.
47 CP_EXPORT void cpCircleShapeSetRadius(cpShape *shape, cpFloat radius);
48 /// Set the offset of a circle shape.
49 CP_EXPORT void cpCircleShapeSetOffset(cpShape *shape, cpVect offset);
51 /// Set the endpoints of a segment shape.
52 CP_EXPORT void cpSegmentShapeSetEndpoints(cpShape *shape, cpVect a, cpVect b);
53 /// Set the radius of a segment shape.
54 CP_EXPORT void cpSegmentShapeSetRadius(cpShape *shape, cpFloat radius);
56 /// Set the vertexes of a poly shape.
57 CP_EXPORT void cpPolyShapeSetVerts(cpShape *shape, int count, cpVect *verts, cpTransform transform);
58 CP_EXPORT void cpPolyShapeSetVertsRaw(cpShape *shape, int count, cpVect *verts);
59 /// Set the radius of a poly shape.
60 CP_EXPORT void cpPolyShapeSetRadius(cpShape *shape, cpFloat radius);