Skip to content
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

Merged
merged 63 commits into from
Aug 12, 2018
Merged

Physics merge #1829

merged 63 commits into from
Aug 12, 2018

Conversation

lahmatbiy
Copy link
Contributor

No description provided.

dvvrd and others added 27 commits June 6, 2015 17:30
# 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>
… [ci skip]

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
Signed-off-by: greg <lahmatbiy@gmail.com>
… stays itself

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
@@ -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
Copy link
Member

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"
Copy link
Member

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.
Copy link
Member

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())
Copy link
Member

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());
Copy link
Member

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.
Copy link
Member

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>
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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;
Copy link
Member

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>
@dvvrd dvvrd merged commit fea5cb6 into qreal:master Aug 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants