axmol/cocos/physics/CCPhysicsBody.cpp

981 lines
23 KiB
C++
Raw Normal View History

/****************************************************************************
Copyright (c) 2013 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
2014-04-27 01:35:57 +08:00
#include "physics/CCPhysicsBody.h"
#if CC_USE_PHYSICS
2013-10-26 12:33:31 +08:00
#include <climits>
2013-09-17 14:31:43 +08:00
#include <algorithm>
#include <cmath>
2013-09-17 14:31:43 +08:00
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
#include "chipmunk/chipmunk_private.h"
2014-05-02 07:42:35 +08:00
#include "2d/CCScene.h"
2015-09-08 09:54:01 +08:00
#include "physics/CCPhysicsShape.h"
#include "physics/CCPhysicsJoint.h"
#include "physics/CCPhysicsWorld.h"
#include "physics/CCPhysicsHelper.h"
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
static void internalBodySetMass(cpBody *body, cpFloat mass)
{
cpBodyActivate(body);
body->m = mass;
body->m_inv = 1.0f/mass;
//cpAssertSaneBody(body);
}
static void internalBodyUpdateVelocity(cpBody *body, cpVect gravity, cpFloat damping, cpFloat dt)
{
cpBodyUpdateVelocity(body, cpvzero, damping, dt);
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
// Skip kinematic bodies.
if(cpBodyGetType(body) == CP_BODY_TYPE_KINEMATIC) return;
cpAssertSoft(body->m > 0.0f && body->i > 0.0f, "Body's mass and moment must be positive to simulate. (Mass: %f Moment: f)", body->m, body->i);
cocos2d::PhysicsBody *physicsBody = static_cast<cocos2d::PhysicsBody*>(body->userData);
if(physicsBody->isGravityEnabled())
body->v = cpvclamp(cpvadd(cpvmult(body->v, damping), cpvmult(cpvadd(gravity, cpvmult(body->f, body->m_inv)), dt)), physicsBody->getVelocityLimit());
else
body->v = cpvclamp(cpvadd(cpvmult(body->v, damping), cpvmult(cpvmult(body->f, body->m_inv), dt)), physicsBody->getVelocityLimit());
cpFloat w_limit = physicsBody->getAngularVelocityLimit();
body->w = cpfclamp(body->w*damping + body->t*body->i_inv*dt, -w_limit, w_limit);
// Reset forces.
body->f = cpvzero;
//to check body sanity
cpBodySetTorque(body, 0.0f);
}
NS_CC_BEGIN
extern const float PHYSICS_INFINITY;
const std::string PhysicsBody::COMPONENT_NAME = "PhysicsBody";
namespace
{
static const float MASS_DEFAULT = 1.0;
static const float MOMENT_DEFAULT = 200;
}
PhysicsBody::PhysicsBody()
2015-09-08 09:54:01 +08:00
: _world(nullptr)
, _cpBody(nullptr)
, _dynamic(true)
, _rotationEnabled(true)
, _gravityEnabled(true)
, _massDefault(true)
, _momentDefault(true)
, _mass(MASS_DEFAULT)
, _area(0.0f)
, _density(0.0f)
, _moment(MOMENT_DEFAULT)
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
, _velocityLimit(PHYSICS_INFINITY)
, _angularVelocityLimit(PHYSICS_INFINITY)
, _isDamping(false)
, _linearDamping(0.0f)
, _angularDamping(0.0f)
, _tag(0)
, _rotationOffset(0)
, _recordedRotation(0.0f)
, _recordedAngle(0.0)
2015-09-08 09:54:01 +08:00
, _massSetByUser(false)
, _momentSetByUser(false)
, _recordScaleX(1.f)
, _recordScaleY(1.f)
{
2015-11-27 21:33:20 +08:00
_name = COMPONENT_NAME;
}
PhysicsBody::~PhysicsBody()
{
for (auto it = _joints.begin(); it != _joints.end(); ++it)
{
PhysicsJoint* joint = *it;
PhysicsBody* other = joint->getBodyA() == this ? joint->getBodyB() : joint->getBodyA();
other->removeJoint(joint);
delete joint;
}
if (_cpBody)
{
cpBodyFree(_cpBody);
}
}
PhysicsBody* PhysicsBody::create()
{
PhysicsBody* body = new (std::nothrow) PhysicsBody();
if (body && body->init())
{
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
PhysicsBody* PhysicsBody::create(float mass)
{
PhysicsBody* body = new (std::nothrow) PhysicsBody();
if (body)
{
body->_mass = mass;
body->_massDefault = false;
if (body->init())
{
body->autorelease();
return body;
}
}
CC_SAFE_DELETE(body);
return nullptr;
}
PhysicsBody* PhysicsBody::create(float mass, float moment)
{
PhysicsBody* body = new (std::nothrow) PhysicsBody();
if (body)
{
body->_mass = mass;
body->_massDefault = false;
body->_moment = moment;
body->_momentDefault = false;
if (body->init())
{
body->autorelease();
return body;
}
}
CC_SAFE_DELETE(body);
return nullptr;
}
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
PhysicsBody* PhysicsBody::createCircle(float radius, const PhysicsMaterial& material, const Vec2& offset)
{
PhysicsBody* body = new (std::nothrow) PhysicsBody();
if (body && body->init())
{
body->addShape(PhysicsShapeCircle::create(radius, material, offset));
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
PhysicsBody* PhysicsBody::createBox(const Size& size, const PhysicsMaterial& material, const Vec2& offset)
{
PhysicsBody* body = new (std::nothrow) PhysicsBody();
if (body && body->init())
{
body->addShape(PhysicsShapeBox::create(size, material, offset));
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
PhysicsBody* PhysicsBody::createPolygon(const Vec2* points, int count, const PhysicsMaterial& material, const Vec2& offset)
{
PhysicsBody* body = new (std::nothrow) PhysicsBody();
if (body && body->init())
{
body->addShape(PhysicsShapePolygon::create(points, count, material, offset));
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
PhysicsBody* PhysicsBody::createEdgeSegment(const Vec2& a, const Vec2& b, const PhysicsMaterial& material, float border/* = 1*/)
{
PhysicsBody* body = new (std::nothrow) PhysicsBody();
if (body && body->init())
{
2013-10-09 17:53:12 +08:00
body->addShape(PhysicsShapeEdgeSegment::create(a, b, material, border));
body->setDynamic(false);
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
PhysicsBody* PhysicsBody::createEdgeBox(const Size& size, const PhysicsMaterial& material, float border/* = 1*/, const Vec2& offset)
{
PhysicsBody* body = new (std::nothrow) PhysicsBody();
if (body && body->init())
{
body->addShape(PhysicsShapeEdgeBox::create(size, material, border, offset));
body->setDynamic(false);
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
PhysicsBody* PhysicsBody::createEdgePolygon(const Vec2* points, int count, const PhysicsMaterial& material, float border/* = 1*/)
{
PhysicsBody* body = new (std::nothrow) PhysicsBody();
if (body && body->init())
{
2013-10-09 17:53:12 +08:00
body->addShape(PhysicsShapeEdgePolygon::create(points, count, material, border));
body->setDynamic(false);
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
PhysicsBody* PhysicsBody::createEdgeChain(const Vec2* points, int count, const PhysicsMaterial& material, float border/* = 1*/)
{
PhysicsBody* body = new (std::nothrow) PhysicsBody();
if (body && body->init())
{
2013-10-09 17:53:12 +08:00
body->addShape(PhysicsShapeEdgeChain::create(points, count, material, border));
body->setDynamic(false);
body->autorelease();
return body;
}
CC_SAFE_DELETE(body);
return nullptr;
}
bool PhysicsBody::init()
{
do
{
_cpBody = cpBodyNew(_mass, _moment);
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
internalBodySetMass(_cpBody, _mass);
cpBodySetUserData(_cpBody, this);
cpBodySetVelocityUpdateFunc(_cpBody, internalBodyUpdateVelocity);
CC_BREAK_IF(_cpBody == nullptr);
return true;
} while (false);
return false;
}
void PhysicsBody::removeJoint(PhysicsJoint* joint)
{
auto it = std::find(_joints.begin(), _joints.end(), joint);
if (it != _joints.end())
{
_joints.erase(it);
}
}
void PhysicsBody::setDynamic(bool dynamic)
{
if (dynamic != _dynamic)
{
_dynamic = dynamic;
if (dynamic)
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
cpBodySetType(_cpBody, CP_BODY_TYPE_DYNAMIC);
internalBodySetMass(_cpBody, _mass);
cpBodySetMoment(_cpBody, _moment);
}
else
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
cpBodySetType(_cpBody, CP_BODY_TYPE_KINEMATIC);
}
}
}
void PhysicsBody::setRotationEnable(bool enable)
{
if (_rotationEnabled != enable)
{
cpBodySetMoment(_cpBody, enable ? _moment : PHYSICS_INFINITY);
_rotationEnabled = enable;
}
}
void PhysicsBody::setGravityEnable(bool enable)
{
_gravityEnabled = enable;
}
void PhysicsBody::setRotation(float rotation)
{
_recordedRotation = rotation;
_recordedAngle = - (rotation + _rotationOffset) * (M_PI / 180.0);
cpBodySetAngle(_cpBody, _recordedAngle);
}
2014-06-27 17:30:21 +08:00
void PhysicsBody::setScale(float scaleX, float scaleY)
{
for (auto shape : _shapes)
{
2015-09-08 09:54:01 +08:00
_area -= shape->getArea();
if (!_massSetByUser)
addMass(-shape->getMass());
if (!_momentSetByUser)
addMoment(-shape->getMoment());
2014-06-27 17:30:21 +08:00
shape->setScale(scaleX, scaleY);
2015-09-08 09:54:01 +08:00
_area += shape->getArea();
if (!_massSetByUser)
addMass(shape->getMass());
if (!_momentSetByUser)
addMoment(shape->getMoment());
2014-06-27 17:30:21 +08:00
}
}
void PhysicsBody::setPosition(float positionX, float positionY)
{
cpVect tt;
tt.x = positionX + _positionOffset.x;
tt.y = positionY + _positionOffset.y;
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
cpBodySetPosition(_cpBody, tt);
}
2015-09-08 09:54:01 +08:00
Vec2 PhysicsBody::getPosition() const
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
cpVect tt = cpBodyGetPosition(_cpBody);
return Vec2(tt.x - _positionOffset.x, tt.y - _positionOffset.y);
}
void PhysicsBody::setPositionOffset(const Vec2& position)
{
if (!_positionOffset.equals(position))
{
Vec2 pos = getPosition();
_positionOffset = position;
setPosition(pos.x, pos.y);
}
}
float PhysicsBody::getRotation()
{
if (_recordedAngle != cpBodyGetAngle(_cpBody)) {
_recordedAngle = cpBodyGetAngle(_cpBody);
_recordedRotation = - _recordedAngle * 180.0 / M_PI - _rotationOffset;
}
return _recordedRotation;
}
PhysicsShape* PhysicsBody::addShape(PhysicsShape* shape, bool addMassAndMoment/* = true*/)
{
if (shape == nullptr) return nullptr;
// add shape to body
2013-12-07 10:48:02 +08:00
if (_shapes.getIndex(shape) == -1)
{
shape->setBody(this);
// calculate the area, mass, and density
// area must update before mass, because the density changes depend on it.
if (addMassAndMoment)
{
_area += shape->getArea();
addMass(shape->getMass());
addMoment(shape->getMoment());
}
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
if (_world && cpBodyGetSpace(_cpBody))
{
_world->addShape(shape);
}
2013-12-07 10:48:02 +08:00
_shapes.pushBack(shape);
}
return shape;
}
void PhysicsBody::applyForce(const Vec2& force, const Vec2& offset)
{
if (_dynamic && _mass != PHYSICS_INFINITY)
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
cpBodyApplyForceAtLocalPoint(_cpBody, PhysicsHelper::point2cpv(force), PhysicsHelper::point2cpv(offset));
}
}
void PhysicsBody::resetForces()
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
cpBodySetForce(_cpBody, PhysicsHelper::point2cpv(Vec2(0,0)));
}
void PhysicsBody::applyImpulse(const Vec2& impulse, const Vec2& offset)
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
cpBodyApplyImpulseAtLocalPoint(_cpBody, PhysicsHelper::point2cpv(impulse), PhysicsHelper::point2cpv(offset));
}
void PhysicsBody::applyTorque(float torque)
{
cpBodySetTorque(_cpBody, torque);
}
void PhysicsBody::setMass(float mass)
{
2013-11-20 10:25:43 +08:00
if (mass <= 0)
{
return;
}
_mass = mass;
_massDefault = false;
2015-09-08 09:54:01 +08:00
_massSetByUser = true;
// update density
if (_mass == PHYSICS_INFINITY)
{
_density = PHYSICS_INFINITY;
}
else
{
if (_area > 0)
{
_density = _mass / _area;
}else
{
_density = 0;
}
}
2013-11-20 10:25:43 +08:00
// the static body's mass and moment is always infinity
if (_dynamic)
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
internalBodySetMass(_cpBody, _mass);
2013-11-20 10:25:43 +08:00
}
}
void PhysicsBody::addMass(float mass)
{
if (mass == PHYSICS_INFINITY)
{
_mass = PHYSICS_INFINITY;
_massDefault = false;
_density = PHYSICS_INFINITY;
}
else if (mass == -PHYSICS_INFINITY)
{
return;
}
else
{
if (_massDefault)
{
_mass = 0;
_massDefault = false;
}
if (_mass + mass > 0)
{
_mass += mass;
}else
{
_mass = MASS_DEFAULT;
_massDefault = true;
}
if (_area > 0)
{
_density = _mass / _area;
}
else
{
_density = 0;
}
}
2013-11-20 10:25:43 +08:00
// the static body's mass and moment is always infinity
if (_dynamic)
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
internalBodySetMass(_cpBody, _mass);
2013-11-20 10:25:43 +08:00
}
}
void PhysicsBody::addMoment(float moment)
{
if (moment == PHYSICS_INFINITY)
{
// if moment is PHYSICS_INFINITY, the moment of the body will become PHYSICS_INFINITY
_moment = PHYSICS_INFINITY;
_momentDefault = false;
}
else if (moment == -PHYSICS_INFINITY)
{
return;
}
else
{
// if moment of the body is PHYSICS_INFINITY is has no effect
if (_moment != PHYSICS_INFINITY)
{
if (_momentDefault)
{
_moment = 0;
_momentDefault = false;
}
if (_moment + moment > 0)
{
_moment += moment;
}
else
{
_moment = MOMENT_DEFAULT;
_momentDefault = true;
}
}
}
2013-11-20 10:25:43 +08:00
// the static body's mass and moment is always infinity
if (_rotationEnabled && _dynamic)
{
cpBodySetMoment(_cpBody, _moment);
}
}
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
void PhysicsBody::setVelocity(const Vec2& velocity)
{
if (!_dynamic)
{
CCLOG("physics warning: your can't set velocity for a static body.");
return;
}
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
cpBodySetVelocity(_cpBody, PhysicsHelper::point2cpv(velocity));
}
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
Vec2 PhysicsBody::getVelocity()
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
return PhysicsHelper::cpv2point(cpBodyGetVelocity(_cpBody));
}
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
Vec2 PhysicsBody::getVelocityAtLocalPoint(const Vec2& point)
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
return PhysicsHelper::cpv2point(cpBodyGetVelocityAtLocalPoint(_cpBody, PhysicsHelper::point2cpv(point)));
}
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
Vec2 PhysicsBody::getVelocityAtWorldPoint(const Vec2& point)
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
return PhysicsHelper::cpv2point(cpBodyGetVelocityAtWorldPoint(_cpBody, PhysicsHelper::point2cpv(point)));
}
void PhysicsBody::setAngularVelocity(float velocity)
{
if (!_dynamic)
{
CCLOG("physics warning: your can't set angular velocity for a static body.");
return;
}
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
cpBodySetAngularVelocity(_cpBody, velocity);
}
float PhysicsBody::getAngularVelocity()
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
return PhysicsHelper::cpfloat2float(cpBodyGetAngularVelocity(_cpBody));
}
void PhysicsBody::setVelocityLimit(float limit)
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
_velocityLimit = limit;
}
float PhysicsBody::getVelocityLimit()
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
return _velocityLimit;
}
void PhysicsBody::setAngularVelocityLimit(float limit)
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
_angularVelocityLimit = limit;
}
float PhysicsBody::getAngularVelocityLimit()
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
return _angularVelocityLimit;
}
void PhysicsBody::setMoment(float moment)
{
_moment = moment;
_momentDefault = false;
2015-09-08 09:54:01 +08:00
_momentSetByUser = true;
2013-11-20 10:25:43 +08:00
// the static body's mass and moment is always infinity
if (_rotationEnabled && _dynamic)
{
cpBodySetMoment(_cpBody, _moment);
}
}
2013-11-05 20:02:58 +08:00
PhysicsShape* PhysicsBody::getShape(int tag) const
{
2013-12-07 10:48:02 +08:00
for (auto& shape : _shapes)
{
if (shape->getTag() == tag)
{
return shape;
}
}
return nullptr;
}
void PhysicsBody::removeShape(int tag, bool reduceMassAndMoment/* = true*/)
{
2013-12-07 10:48:02 +08:00
for (auto& shape : _shapes)
{
if (shape->getTag() == tag)
{
removeShape(shape, reduceMassAndMoment);
return;
}
}
}
void PhysicsBody::removeShape(PhysicsShape* shape, bool reduceMassAndMoment/* = true*/)
{
if (_shapes.getIndex(shape) != -1)
{
// deduce the area, mass and moment
// area must update before mass, because the density changes depend on it.
if (reduceMassAndMoment)
{
_area -= shape->getArea();
addMass(-shape->getMass());
addMoment(-shape->getMoment());
}
//remove
if (_world)
{
_world->removeShape(shape);
}
// set shape->_body = nullptr make the shape->setBody will not trigger the _body->removeShape function call.
shape->_body = nullptr;
shape->setBody(nullptr);
_shapes.eraseObject(shape);
}
}
void PhysicsBody::removeAllShapes(bool reduceMassAndMoment/* = true*/)
{
2013-12-07 10:48:02 +08:00
for (auto& child : _shapes)
{
PhysicsShape* shape = dynamic_cast<PhysicsShape*>(child);
// deduce the area, mass and moment
// area must update before mass, because the density changes depend on it.
if (reduceMassAndMoment)
{
_area -= shape->getArea();
addMass(-shape->getMass());
addMoment(-shape->getMoment());
}
if (_world)
{
_world->removeShape(shape);
}
// set shape->_body = nullptr make the shape->setBody will not trigger the _body->removeShape function call.
shape->_body = nullptr;
shape->setBody(nullptr);
}
2013-12-07 10:48:02 +08:00
_shapes.clear();
}
void PhysicsBody::removeFromWorld()
{
removeFromPhysicsWorld();
2015-09-08 09:54:01 +08:00
}
void PhysicsBody::setEnabled(bool enable)
{
if (_enabled != enable)
{
_enabled = enable;
if (_world)
{
if (enable)
{
_world->addBodyOrDelay(this);
}else
{
_world->removeBodyOrDelay(this);
}
}
}
}
2013-11-01 16:26:03 +08:00
bool PhysicsBody::isResting() const
{
2016-05-06 11:30:16 +08:00
return cpBodyIsSleeping(_cpBody) != cpFalse;
}
2014-02-26 19:56:52 +08:00
void PhysicsBody::setResting(bool rest) const
{
2014-02-26 19:56:52 +08:00
if (rest && !isResting())
{
cpBodySleep(_cpBody);
}
else if(!rest && isResting())
2014-02-26 19:56:52 +08:00
{
cpBodyActivate(_cpBody);
2014-02-26 19:56:52 +08:00
}
}
void PhysicsBody::update(float delta)
{
2015-09-08 09:54:01 +08:00
// damping compute
if (_isDamping && _dynamic && !isResting())
2014-02-24 16:17:42 +08:00
{
2015-09-08 09:54:01 +08:00
_cpBody->v.x *= cpfclamp(1.0f - delta * _linearDamping, 0.0f, 1.0f);
_cpBody->v.y *= cpfclamp(1.0f - delta * _linearDamping, 0.0f, 1.0f);
_cpBody->w *= cpfclamp(1.0f - delta * _angularDamping, 0.0f, 1.0f);
}
}
void PhysicsBody::setCategoryBitmask(int bitmask)
{
for (auto& shape : _shapes)
{
shape->setCategoryBitmask(bitmask);
}
}
2014-08-08 16:38:20 +08:00
int PhysicsBody::getCategoryBitmask() const
{
if (!_shapes.empty())
{
return _shapes.front()->getCategoryBitmask();
}
else
{
return UINT_MAX;
}
}
void PhysicsBody::setContactTestBitmask(int bitmask)
{
for (auto& shape : _shapes)
{
shape->setContactTestBitmask(bitmask);
}
}
2014-08-08 16:38:20 +08:00
int PhysicsBody::getContactTestBitmask() const
{
if (!_shapes.empty())
{
return _shapes.front()->getContactTestBitmask();
}
else
{
return 0x00000000;
}
}
void PhysicsBody::setCollisionBitmask(int bitmask)
{
for (auto& shape : _shapes)
{
shape->setCollisionBitmask(bitmask);
}
}
2014-08-08 16:38:20 +08:00
int PhysicsBody::getCollisionBitmask() const
{
if (!_shapes.empty())
{
return _shapes.front()->getCollisionBitmask();
}
else
{
return UINT_MAX;
}
}
void PhysicsBody::setGroup(int group)
{
for (auto& shape : _shapes)
{
shape->setGroup(group);
}
}
2014-08-08 16:38:20 +08:00
int PhysicsBody::getGroup() const
{
if (!_shapes.empty())
{
return _shapes.front()->getGroup();
}
else
{
return 0;
}
}
void PhysicsBody::setRotationOffset(float rotation)
{
if (std::abs(_rotationOffset - rotation) > 0.5f)
{
float rot = getRotation();
_rotationOffset = rotation;
setRotation(rot);
}
}
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
Vec2 PhysicsBody::world2Local(const Vec2& point)
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
return PhysicsHelper::cpv2point(cpBodyWorldToLocal(_cpBody, PhysicsHelper::point2cpv(point)));
}
Squashed commit of the following: commit a9572b8913f3a38b59adbd7b4017ab9848a6b2b5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed May 14 10:03:44 2014 -0700 math renames `Vector2` -> `Vec2` `Vector3` -> `Vec3` `Vector4` -> `Vec4` `Matrix` -> `Mat4` commit 4e107f4bd854c26bfceb52b063d6bd9cea02d6a3 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:24:28 2014 -0700 raw version of rename Vector3 commit 1d115573ebe96a5fc815fa44fbe6417ea7dba841 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:07:14 2014 -0700 rename Vector2 after merge commit ab2ed58c129dbc30a4c0970ed94568c5d271657b Merge: 1978d2d 86fb75a Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 09:05:30 2014 -0700 Merge branch 'v3' into v3_renameMathClassName Conflicts: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISliderTest/UISliderTest_Editor.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest.cpp tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextFieldTest/UITextFieldTest_Editor.cpp commit 1978d2d174877172ccddc083020a1bbf43ad3b39 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 08:51:45 2014 -0700 rename vector2 in tests/cpp-empty-test folder commit d4e0ff13dcce62724d2fece656543f26aa28e467 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:58:23 2014 -0700 rename vector2 in tests/cpp-tests cpp files commit be50ca2ec75e0fd32a6fcdaa15fe1ebb4cafe79f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:52:57 2014 -0700 rename vector2 in tests/cpp-tests head files commit 6daef564400d4e28c4ce20859a68e0f583fed125 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:49:48 2014 -0700 rename vector2 in extension folder commit 8f3f0f65ceea92c9e7a0d87ab54e62220c5572e2 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:47:22 2014 -0700 rename vector2 in cocos/2d cpp files commit e1f3105aae06d595661a3030f519f7cc13aefbed Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:44:39 2014 -0700 rename vector2 in cocos/2d head files commit 6708d890bfe486109120c3cd4b9fe5c078b7108f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:59 2014 -0700 rename vector2 in cocos/base folder commit d3978fa5447c31ea2f3ece5469b7e746dfba4248 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:43 2014 -0700 rename vector2 in cocos/deprecated folder commit 4bff45139363d6b9706edbbcf9f322d48b4fd019 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:40:26 2014 -0700 rename vector2 in cocos/editor-support folder commit 353d244c995f8b5d14f635c52aed8bc5e5fc1a6f Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:36:48 2014 -0700 rename vector2 in cocos/ui folder commit 758b8f4d513084b9922d7242e9b8f2c7f316de6c Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:39 2014 -0700 rename vector2 in cocos/renderer folder commit 0bd2710dd8714cecb993880bc37affd9ecb05c27 Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:32:15 2014 -0700 rename vector2 in cocos/physics folder commit b7f0581c4587348bdbc1478d5374c2325735f21d Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:25:01 2014 -0700 rename vector2 in cocos/math folder commit a8631a8e1a4e2740807ccd9be9d70de6ecaad7dd Author: Huabing.Xu <dabingnn@gmail.com> Date: Wed May 14 00:16:55 2014 -0700 rename Vector2 to Vec2 deprecate typedef Vector2
2014-05-15 01:07:09 +08:00
Vec2 PhysicsBody::local2World(const Vec2& point)
{
Squashed commit of the following: commit 36c2807d07848448c1fed86f4b119205048691bf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 13:11:40 2016 -0800 binary file 82 commit 9b7cd003b12faefd0522d12f765c027efb001ab2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:56:39 2016 -0800 fore multiple in windows phone 8.1 too commit daea8a3ef8d69915e7a9d962fd745a1103011bab Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 12:50:45 2016 -0800 force multiple commit 0fbabdbf99974e95de083d79c7d6ae7cf735e4b6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 10:44:40 2016 -0800 compiles commit f817766afcd0ffc4ca93f628d55fabc4b5a96ba5 Merge: 7b2cea3 8bf3d33 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 29 09:37:24 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 7b2cea329a56ae2786428d39a499bc12ba3860e6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Sat Feb 27 01:11:13 2016 -0800 correct paths for win8.1 commit dcf1f046eb1e18474d6f94b2d7dc31fbf1b06cea Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 22:46:58 2016 -0800 projects works on win32 commit ab5b14c25ef0fdf224480302f9cb3cc01d5c360c Merge: 04377cc 9af2f4e Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:57:10 2016 -0800 Merge branch 'v3' into chipmunk_v7_2 commit 04377cce7f46b2c2016ccc3855fc479c4f6aa516 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 26 21:26:55 2016 -0800 trying to make it compile on win32 commit 7703946d99e1cdc6a57f2ccb2a868818c1367291 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 10:28:12 2016 -0800 quick hack to make it compile... ...autogenerated files will fix it. commit ea35bf3a5894cb80b09ecd0a4a5408dcc19785f5 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 24 09:20:59 2016 -0800 Squashed commit of the following: commit 487e52a7af7cdb40135fd3bd83b2efba0dfe6265 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 20:10:13 2016 -0800 compiles.. sort of commit a7990e2888d5ef1e43b811148b23c0b899105ab3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:55:24 2016 -0800 more chipmunk fixes commit 1174f6ec8201324161d7946af0f493b136a56690 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:36:15 2016 -0800 more chipmunk fixes commit 00ac2449ca0c35bd9184310d58e74aaa05bd1323 Merge: f942c5a 0594d3c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:29:27 2016 -0800 Merge branch 'chipmunk_v7_squashed' of github.com:ricardoquesada/cocos2d-x into chipmunk_v7_squashed commit f942c5a3cc7b24f3ac211d781be1b9c9d4ec0fd7 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 19:28:51 2016 -0800 correct path for chipmunk commit 0594d3c4141d390b2566ea76101e383f15ebcaaf Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 18:44:05 2016 -0800 compiles on ios commit 379503399c384ad77d25d68a2f83b71a829b1c04 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:51:36 2016 -0800 chipmunk include fixes commit 95839fb7b406a32255853294b016d8c15aec1ed6 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 17:09:04 2016 -0800 fixes for cmake + mac commit 39449ea3b7efccae2946785c1c11433d964ee480 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:51:25 2016 -0800 correct includes commit 98e97d7d2f00e6a78d040dcaf17e5a077e9a88c3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 16:35:40 2016 -0800 fixes chipmunk with cmake commit 337f21f9466703722847635301d841ace9b757cb Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:42:01 2016 -0800 updates android and linux projects commit 7111a9993b97f78cf73206804b25665c21a59ca8 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 14:18:26 2016 -0800 cosmetic changes commit ce15038b8d2c0c7ebe31b4e1efe92646b7c70d1b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:53:41 2016 -0800 chipmunk autogenerated files commit 66c71bfa3aaab04abf25f284e2e76ce2a74a98de Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:47:41 2016 -0800 compatibility both in JS (to reduce space) and in C for (C++ users) commit 0f9ffa0a8ab23a19e1f10b04e6987c2288764b1f Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 06:10:02 2016 -0800 mooooore fixes commit 9ab23014093677e8eda69b105f50410b8c792aa3 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:30:58 2016 -0800 doesn't crash with collision handler commit 69275a16817a038244bbaaff9e82a011b6729cb2 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Tue Feb 23 05:16:29 2016 -0800 adds missing space functions commit a6b97bbc76cb9ab293356bb7451cfa858353f589 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 22:22:27 2016 -0800 queries... better commit 3442bceca64f5a0ddbbbb1a288146a2a61d87632 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 19:48:41 2016 -0800 adds more missing functions fixes other chipmunk JS issues commit 3797a033896d059da58a05ce0de832ed9c150eff Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 18:30:21 2016 -0800 yep... poly works ok commit d1bb57776891605b9d3e4fb90736c6869d96b944 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:29 2016 -0800 neede compat files commit 39ec518d4e089124d9a53fe3a8dce3aa0474c233 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Mon Feb 22 17:28:04 2016 -0800 query working! commit 71a8001fd6bc03ac674621f5da38a3f8778430b4 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:57:03 2016 -0800 almost there commit 9272fdcd06ba188db2fe5701fb2ac21476d54883 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 21:18:46 2016 -0800 fixes return values commit 7218778da846e1e36a510c0a19a5ee76f91db032 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 20:36:14 2016 -0800 cpMomentForSegment is manual since parameter 4 is optional in chipmunk 6, but not in 7 commit 98d5d3e23c2cdb941cc0b1f3ce8275990356e88d Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 17:29:28 2016 -0800 yeah... process the arguments correctly works both for functions and auto_classes commit ce6a4fe3593b4f3b0fcdf11d12e297d789e0d96b Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 16:49:00 2016 -0800 compiles and links fixes some issues with the queries. returns shapes instad of the queryInfo commit 3f879482dc6db86e45e4319bc802ccf19b52a46c Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Fri Feb 19 15:03:18 2016 -0800 adds removeCollisionHandler and other fixes commit 32d825fc7bd323e144db6a1badc4a62420b6ea44 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Thu Feb 18 20:59:24 2016 -0800 compiles... doesn't work yet commit bd64de81713fb2d7652a538d667d73f05f5d9320 Author: Ricardo Quesada <ricardoquesada@gmail.com> Date: Wed Feb 17 18:17:39 2016 -0800 WIP: chipmunk bindings
2016-03-01 05:53:00 +08:00
return PhysicsHelper::cpv2point(cpBodyLocalToWorld(_cpBody, PhysicsHelper::point2cpv(point)));
}
void PhysicsBody::beforeSimulation(const Mat4& parentToWorldTransform, const Mat4& nodeToWorldTransform, float scaleX, float scaleY, float rotation)
{
if (_recordScaleX != scaleX || _recordScaleY != scaleY)
{
_recordScaleX = scaleX;
_recordScaleY = scaleY;
setScale(scaleX, scaleY);
}
// set rotation
if (_recordedRotation != rotation)
{
setRotation(rotation);
}
// set position
auto worldPosition = _ownerCenterOffset;
nodeToWorldTransform.transformVector(worldPosition.x, worldPosition.y, worldPosition.z, 1.f, &worldPosition);
setPosition(worldPosition.x, worldPosition.y);
_recordPosX = worldPosition.x;
_recordPosY = worldPosition.y;
if (_owner->getAnchorPoint() != Vec2::ANCHOR_MIDDLE)
{
parentToWorldTransform.getInversed().transformVector(worldPosition.x, worldPosition.y, worldPosition.z, 1.f, &worldPosition);
_offset.x = worldPosition.x - _owner->getPositionX();
_offset.y = worldPosition.y - _owner->getPositionY();
}
}
void PhysicsBody::afterSimulation(const Mat4& parentToWorldTransform, float parentRotation)
{
// set Node position
auto tmp = getPosition();
Vec3 positionInParent(tmp.x, tmp.y, 0.f);
if (_recordPosX != positionInParent.x || _recordPosY != positionInParent.y)
{
parentToWorldTransform.getInversed().transformVector(positionInParent.x, positionInParent.y, positionInParent.z, 1.f, &positionInParent);
_owner->setPosition(positionInParent.x - _offset.x, positionInParent.y - _offset.y);
}
// set Node rotation
_owner->setRotation(getRotation() - parentRotation);
}
void PhysicsBody::onEnter()
{
addToPhysicsWorld();
}
void PhysicsBody::onExit()
{
removeFromPhysicsWorld();
}
void PhysicsBody::onAdd()
{
_owner->_physicsBody = this;
auto contentSize = _owner->getContentSize();
_ownerCenterOffset.x = 0.5 * contentSize.width;
_ownerCenterOffset.y = 0.5 * contentSize.height;
setRotationOffset(_owner->getRotation());
// component may be added after onEnter() has been invoked, so we should add
// this line to make sure physics body is added to physics world
addToPhysicsWorld();
}
void PhysicsBody::onRemove()
{
removeFromPhysicsWorld();
}
void PhysicsBody::addToPhysicsWorld()
{
if (_owner)
{
auto scene = _owner->getScene();
if (scene)
scene->getPhysicsWorld()->addBody(this);
}
}
void PhysicsBody::removeFromPhysicsWorld()
{
if (_world)
{
_world->removeBody(this);
_world = nullptr;
}
}
NS_CC_END
#endif // CC_USE_PHYSICS