blob: d3451769be7bad18557fe5623493e2e35890f2b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
--- lel/cocos2d-x-3.14/cocos/physics/CCPhysicsBody.cpp 2016-12-29 13:42:38.000000000 -0400
+++ /opt/cocos2d-x-git/cocos/physics/CCPhysicsBody.cpp 2017-01-08 12:02:19.747686186 -0400
@@ -575,12 +575,12 @@
void PhysicsBody::setVelocity(const Vec2& velocity)
{
- if (!_dynamic)
+ if (cpBodyGetType(_cpBody) == CP_BODY_TYPE_STATIC)
{
- CCLOG("physics warning: your can't set velocity for a static body.");
+ CCLOG("physics warning: you can't set velocity for a static body.");
return;
}
-
+
cpBodySetVelocity(_cpBody, PhysicsHelper::point2cpv(velocity));
}
@@ -601,12 +601,12 @@
void PhysicsBody::setAngularVelocity(float velocity)
{
- if (!_dynamic)
+ if (cpBodyGetType(_cpBody) == CP_BODY_TYPE_STATIC)
{
- CCLOG("physics warning: your can't set angular velocity for a static body.");
+ CCLOG("physics warning: you can't set angular velocity for a static body.");
return;
}
-
+
cpBodySetAngularVelocity(_cpBody, velocity);
}
|