コード例 #1
0
ファイル: Car.cpp プロジェクト: Bryans91/Box2DSFML
	b2Vec2 getForwardVelocity() {
		b2Vec2 currentForwardNormal = w_body->GetWorldVector(b2Vec2(0, 1));
		return b2Dot(currentForwardNormal, w_body->GetLinearVelocity()) * currentForwardNormal;
	}
コード例 #2
0
ファイル: Car.cpp プロジェクト: Bryans91/Box2DSFML
	b2Vec2 getLateralVelocity() {
		b2Vec2 currentRightNormal = w_body->GetWorldVector(b2Vec2(1, 0));
		return b2Dot(currentRightNormal, w_body->GetLinearVelocity()) * currentRightNormal;
	}