Munk2D Documentation  8.x.x
Loading...
Searching...
No Matches
chipmunk_unsafe.h
1/* Copyright (c) 2025 Victor Blomqvist
2 * Copyright (c) 2007-2024 Scott Lembcke and Howling Moon Software
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 * SOFTWARE.
21*/
22
23/* This header defines a number of "unsafe" operations on Chipmunk objects.
24 * In this case "unsafe" is referring to operations which may reduce the
25 * physical accuracy or numerical stability of the simulation, but will not
26 * cause crashes.
27 *
28 * The prime example is mutating collision shapes. Chipmunk does not support
29 * this directly. Mutating shapes using this API will caused objects in contact
30 * to be pushed apart using Chipmunk's overlap solver, but not using real
31 * persistent velocities. Probably not what you meant, but perhaps close enough.
32 */
33
39
40#ifndef CHIPMUNK_UNSAFE_H
41#define CHIPMUNK_UNSAFE_H
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
48CP_EXPORT void cpCircleShapeSetRadius(cpShape *shape, cpFloat radius);
50CP_EXPORT void cpCircleShapeSetOffset(cpShape *shape, cpVect offset);
51
53CP_EXPORT void cpSegmentShapeSetEndpoints(cpShape *shape, cpVect a, cpVect b);
55CP_EXPORT void cpSegmentShapeSetRadius(cpShape *shape, cpFloat radius);
56
58CP_EXPORT void cpPolyShapeSetVerts(cpShape *shape, int count, cpVect *verts, cpTransform transform);
59CP_EXPORT void cpPolyShapeSetVertsRaw(cpShape *shape, int count, cpVect *verts);
61CP_EXPORT void cpPolyShapeSetRadius(cpShape *shape, cpFloat radius);
62
63#ifdef __cplusplus
64}
65#endif
66#endif
double cpFloat
Chipmunk's floating point type.
Definition chipmunk_types.h:68
CP_EXPORT void cpCircleShapeSetRadius(cpShape *shape, cpFloat radius)
Set the radius of a circle shape.
CP_EXPORT void cpSegmentShapeSetRadius(cpShape *shape, cpFloat radius)
Set the radius of a segment shape.
CP_EXPORT void cpPolyShapeSetRadius(cpShape *shape, cpFloat radius)
Set the radius of a poly shape.
CP_EXPORT void cpCircleShapeSetOffset(cpShape *shape, cpVect offset)
Set the offset of a circle shape.
CP_EXPORT void cpPolyShapeSetVerts(cpShape *shape, int count, cpVect *verts, cpTransform transform)
Set the vertexes of a poly shape.
CP_EXPORT void cpSegmentShapeSetEndpoints(cpShape *shape, cpVect a, cpVect b)
Set the endpoints of a segment shape.
Definition chipmunk_structs.h:178
Column major affine transform.
Definition chipmunk_types.h:258
Definition chipmunk_types.h:251