Chipmunk2D Pro API Reference
7.0.0
Main Page
Modules
Classes
Files
File List
All
Classes
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Groups
Pages
include
chipmunk
cpShape.h
1
/* Copyright (c) 2013 Scott Lembcke and Howling Moon Software
2
*
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:
9
*
10
* The above copyright notice and this permission notice shall be included in
11
* all copies or substantial portions of the Software.
12
*
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
19
* SOFTWARE.
20
*/
21
25
27
typedef
struct
cpPointQueryInfo
{
29
const
cpShape
*
shape
;
31
cpVect
point
;
33
cpFloat
distance
;
36
cpVect
gradient
;
37
}
cpPointQueryInfo
;
38
40
typedef
struct
cpSegmentQueryInfo
{
42
const
cpShape
*
shape
;
44
cpVect
point
;
46
cpVect
normal
;
48
cpFloat
alpha
;
49
}
cpSegmentQueryInfo
;
50
52
typedef
struct
cpShapeFilter
{
55
cpGroup
group
;
58
cpBitmask
categories
;
61
cpBitmask
mask
;
62
}
cpShapeFilter
;
63
65
static
const
cpShapeFilter
CP_SHAPE_FILTER_ALL
= {
CP_NO_GROUP
,
CP_ALL_CATEGORIES
, CP_ALL_CATEGORIES};
67
static
const
cpShapeFilter
CP_SHAPE_FILTER_NONE
= {
CP_NO_GROUP
, ~
CP_ALL_CATEGORIES
, ~
CP_ALL_CATEGORIES
};
68
70
static
inline
cpShapeFilter
71
cpShapeFilterNew
(
cpGroup
group,
cpBitmask
categories,
cpBitmask
mask)
72
{
73
cpShapeFilter
filter = {group, categories, mask};
74
return
filter;
75
}
76
78
void
cpShapeDestroy
(
cpShape
*shape);
80
void
cpShapeFree
(
cpShape
*shape);
81
83
cpBB
cpShapeCacheBB
(
cpShape
*shape);
85
cpBB
cpShapeUpdate
(
cpShape
*shape,
cpTransform
transform);
86
89
cpFloat
cpShapePointQuery
(
const
cpShape
*shape,
cpVect
p,
cpPointQueryInfo
*out);
90
92
cpBool
cpShapeSegmentQuery
(
const
cpShape
*shape,
cpVect
a,
cpVect
b,
cpFloat
radius,
cpSegmentQueryInfo
*info);
93
95
cpContactPointSet
cpShapesCollide
(
const
cpShape
*a,
const
cpShape
*b);
96
98
cpSpace
*
cpShapeGetSpace
(
const
cpShape
*shape);
99
101
cpBody
*
cpShapeGetBody
(
const
cpShape
*shape);
104
void
cpShapeSetBody
(
cpShape
*shape,
cpBody
*body);
105
107
cpFloat
cpShapeGetMass
(
cpShape
*shape);
109
void
cpShapeSetMass
(
cpShape
*shape,
cpFloat
mass);
110
112
cpFloat
cpShapeGetDensity
(
cpShape
*shape);
114
void
cpShapeSetDensity
(
cpShape
*shape,
cpFloat
density);
115
117
cpFloat
cpShapeGetMoment
(
cpShape
*shape);
119
cpFloat
cpShapeGetArea
(
cpShape
*shape);
121
cpVect
cpShapeGetCenterOfGravity
(
cpShape
*shape);
122
124
cpBB
cpShapeGetBB
(
const
cpShape
*shape);
125
127
cpBool
cpShapeGetSensor
(
const
cpShape
*shape);
129
void
cpShapeSetSensor
(
cpShape
*shape,
cpBool
sensor);
130
132
cpFloat
cpShapeGetElasticity
(
const
cpShape
*shape);
134
void
cpShapeSetElasticity
(
cpShape
*shape,
cpFloat
elasticity);
135
137
cpFloat
cpShapeGetFriction
(
const
cpShape
*shape);
139
void
cpShapeSetFriction
(
cpShape
*shape,
cpFloat
friction);
140
142
cpVect
cpShapeGetSurfaceVelocity
(
const
cpShape
*shape);
144
void
cpShapeSetSurfaceVelocity
(
cpShape
*shape,
cpVect
surfaceVelocity);
145
147
cpDataPointer
cpShapeGetUserData
(
const
cpShape
*shape);
149
void
cpShapeSetUserData
(
cpShape
*shape,
cpDataPointer
userData);
150
152
cpCollisionType
cpShapeGetCollisionType
(
const
cpShape
*shape);
154
void
cpShapeSetCollisionType
(
cpShape
*shape,
cpCollisionType
collisionType);
155
157
cpShapeFilter
cpShapeGetFilter
(
const
cpShape
*shape);
159
void
cpShapeSetFilter
(
cpShape
*shape,
cpShapeFilter
filter);
160
161
164
166
cpCircleShape
* cpCircleShapeAlloc(
void
);
168
cpCircleShape
* cpCircleShapeInit(
cpCircleShape
*circle,
cpBody
*body,
cpFloat
radius,
cpVect
offset);
170
cpShape
* cpCircleShapeNew(
cpBody
*body,
cpFloat
radius,
cpVect
offset);
171
173
cpVect
cpCircleShapeGetOffset(
const
cpShape
*shape);
175
cpFloat
cpCircleShapeGetRadius(
const
cpShape
*shape);
176
179
181
cpSegmentShape
* cpSegmentShapeAlloc(
void
);
183
cpSegmentShape
* cpSegmentShapeInit(
cpSegmentShape
*seg,
cpBody
*body,
cpVect
a,
cpVect
b,
cpFloat
radius);
185
cpShape
* cpSegmentShapeNew(
cpBody
*body,
cpVect
a,
cpVect
b,
cpFloat
radius);
186
188
void
cpSegmentShapeSetNeighbors(
cpShape
*shape,
cpVect
prev,
cpVect
next);
189
191
cpVect
cpSegmentShapeGetA(
const
cpShape
*shape);
193
cpVect
cpSegmentShapeGetB(
const
cpShape
*shape);
195
cpVect
cpSegmentShapeGetNormal(
const
cpShape
*shape);
197
cpFloat
cpSegmentShapeGetRadius(
const
cpShape
*shape);
198
Generated on Tue Jan 13 2015 14:32:04 for Chipmunk2D Pro API Reference by
1.8.3.1