-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Physics merge #1829
Physics merge #1829
Conversation
…all items on scene
# Conflicts: # plugins/robots/common/twoDModel/src/engine/model/robotModel.cpp
# Conflicts: # installer/packages/trik-studio/ru.qreal.root.trik_studio_kernel/meta/package.xml # plugins/robots/common/twoDModel/include/twoDModel/engine/model/constants.h # plugins/robots/interpreters/trikKitInterpreterCommon/src/robotModel/twoD/trikTwoDRobotModel.cpp # plugins/robots/robots.pro
# Conflicts: # plugins/robots/common/twoDModel/src/engine/model/physics/realisticPhysicsEngine.cpp # plugins/robots/common/twoDModel/src/engine/model/robotModel.cpp
# Conflicts: # installer/packages/trik-studio/ru.qreal.root.trik_studio_kernel/meta/package.xml # plugins/robots/common/common.pro # plugins/robots/common/twoDModel/include/twoDModel/engine/model/constants.h # plugins/robots/common/twoDModel/include/twoDModel/engine/model/robotModel.h # plugins/robots/common/twoDModel/include/twoDModel/engine/model/sensorsConfiguration.h # plugins/robots/common/twoDModel/include/twoDModel/engine/model/worldModel.h # plugins/robots/common/twoDModel/src/engine/model/model.cpp # plugins/robots/common/twoDModel/src/engine/model/physics/physicsEngineBase.h # plugins/robots/common/twoDModel/src/engine/model/physics/realisticPhysicsEngine.cpp # plugins/robots/common/twoDModel/src/engine/model/physics/simplePhysicsEngine.cpp # plugins/robots/common/twoDModel/src/engine/model/robotModel.cpp # plugins/robots/common/twoDModel/twoDModel.pri # plugins/robots/generators/generators.pro # plugins/robots/generators/trik/trikV62RuntimeUploaderPlugin/trikV62RuntimeUploaderPlugin.cpp # plugins/robots/generators/trik/trikV6RuntimeUploaderPlugin/trikV6RuntimeUploaderPlugin.cpp # plugins/robots/robots.pro # plugins/robots/thirdparty/thirdparty.pro # plugins/robots/utils/src/uploaderTool.cpp # qrkernel/platformInfo.cpp # qrkernel/platformInfo.h
Signed-off-by: greg <lahmatbiy@gmail.com>
Signed-off-by: greg <lahmatbiy@gmail.com>
… [ci skip] Signed-off-by: greg <lahmatbiy@gmail.com>
Signed-off-by: greg <lahmatbiy@gmail.com>
Signed-off-by: greg <lahmatbiy@gmail.com>
…merge # Conflicts: # installer/packages/trik-studio/ru.qreal.root.trik_studio_kernel/meta/package.xml
12bf43f
to
c4fcfc3
Compare
Signed-off-by: greg <lahmatbiy@gmail.com>
… stays itself Signed-off-by: greg <lahmatbiy@gmail.com>
Signed-off-by: greg <lahmatbiy@gmail.com>
…r frame now. Signed-off-by: greg <lahmatbiy@gmail.com>
IMPORTANT (do not rely on scene position, scene position is updated with frames only) Signed-off-by: greg <lahmatbiy@gmail.com>
Signed-off-by: greg <lahmatbiy@gmail.com>
…kittles (dynamic items) Signed-off-by: greg <lahmatbiy@gmail.com>
…merge # Conflicts: # plugins/robots/common/twoDModel/include/twoDModel/engine/model/sensorsConfiguration.h # plugins/robots/common/twoDModel/include/twoDModel/engine/model/worldModel.h # plugins/robots/common/twoDModel/src/engine/model/sensorsConfiguration.cpp # plugins/robots/common/twoDModel/src/engine/model/worldModel.cpp
Signed-off-by: greg <lahmatbiy@gmail.com>
65bdb70
to
9c3cd07
Compare
@@ -27,5 +27,3 @@ mkdir -p trikRuntime | |||
cd trikRuntime | |||
tar xfvz ../trik-runtime-builds/trikRuntime.tar.gz | |||
rm -rf ../trik-runtime-builds | |||
cd "$(dirname "$0")"/../data/trik-runtime-builds | |||
rm -rf .git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
надо будет проверить, не запаковываем ли мы случайно .git в инсталлер
@@ -26,6 +27,7 @@ fix_qreal_dependencies "$BUNDLE_CONTENTS/Lib/plugins/editors/librobotsMetamodel. | |||
fix_qreal_dependencies "$BUNDLE_CONTENTS/Lib/plugins/tools/librobots-plugin.dylib" | |||
fix_qreal_dependencies "$BUNDLE_CONTENTS/Lib/librobots-interpreter-core.1.0.0.dylib" | |||
fix_qreal_dependencies "$BUNDLE_CONTENTS/Lib/librobots-2d-model.1.0.0.dylib" | |||
fix_qreal_dependencies "$BUNDLE_CONTENTS/Lib/Box2D.1.0.0.dylib" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а почему тут Box2D а выше libBox2D?
/// By default returns center of robot`s rectangle. | ||
virtual QPointF rotationCenter() const; | ||
|
||
/// Returns a point(pixels) list of wheels coordinates on robot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
пробел перед (pixels)
|
||
BallItem::BallItem(const QPointF &position) | ||
: SolidItem() | ||
, mStartPosition(QPointF()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
этого можно и не писать, здесь только лишняя работа
QPolygonF BallItem::collidingPolygon() const | ||
{ | ||
QRectF rect = {{0, 0}, ballSize - QSize(1, 1)}; | ||
rect.moveTo(scenePos()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а почему нельзя сразу QPolygonF({scenePos(), ballSize - QSize(1, 1)})
?
localPos = transform.map(localPos); | ||
|
||
const b2Vec2 pos = mEngine->positionToBox2D(localPos - localCenter + mModel->rotationCenter()); | ||
// IMPORTANT: we connect every sensors with box2d circle item. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
every sensor
* limitations under the License. */ | ||
#include "box2DPhysicsEngine.h" | ||
|
||
#include <QDebug> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не нужен
mBox2DRobots[robot]->setRotation(angleToBox2D(newAngle)); | ||
} | ||
|
||
void Box2DPhysicsEngine::onMouseReleased(QPointF newPos, qreal newAngle) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const &
onPressedReleasedSelectedItems(false); | ||
} | ||
|
||
void Box2DPhysicsEngine::onRecoverRobotPosition(QPointF pos) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const &
|
||
b2FixtureDef fixture; | ||
fixture.restitution = 0.8; | ||
b2CircleShape circleShape; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выделение shape-ов можно сделать и в ветках if
Signed-off-by: greg <lahmatbiy@gmail.com>
Signed-off-by: greg <lahmatbiy@gmail.com>
No description provided.