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

Experiments with AI and physics #17

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Experiments with AI and physics #17

wants to merge 1 commit into from

Conversation

JayFoxRox
Copy link
Owner

@JayFoxRox JayFoxRox commented Sep 6, 2019

Not to be merged. Only uploading incomplete work for archival purposes.

  • Needs a fixup to avoid loading my temporary files, code is marked in review comments
  • You can hold O to carry the box (to get the physics model up to speed)
  • You can press P to make blue particles stick (to flip the box, as if it was crashing on a wave)

The "Monaco" course is not being uploaded, but here's an old screenshot of the old blockout in Blender:
The actual track layout was a reimagined Monaco F1 track, with a custom theme (jungle, port, tunnels).

Monaco blockout

@@ -179,10 +198,49 @@ int main(int argc, char* argv[]) {
boat.position.x = i * 12.0f;
}

std::shared_ptr<Model> testModel = std::make_shared<Model>("data/model/test");
// std::shared_ptr<Model> testModel = std::make_shared<Model>("data/model/test");
std::shared_ptr<Model> testModel = std::make_shared<Model>("/home/fox/Data/Projects/boat-game-proto-data/data/monaco");
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs fixing locally


// Load particles from file
{
FILE* f = fopen("/home/fox/box-constraint.obj", "rb");
Copy link
Owner Author

@JayFoxRox JayFoxRox Sep 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs fixing locally.

You can craft your own object using blender, including hinges and so on; see "Articulated Bodies" at http://graphics.cs.cmu.edu/nsp/course/15-869/2006/papers/jakobsen.htm.

If you change the mesh from the one below, then you also have to fix the indices in the source-code.

This file is:

# Blender v2.79 (sub 0) OBJ File: ''
# www.blender.org
mtllib box-constraint.mtl
o Cube_Cube.001
v -1.000000 -1.000000 1.000000
v -1.000000 1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v -1.000000 1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v 1.000000 1.000000 1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -1.000000
l 3 1
l 1 2
l 2 4
l 4 3
l 7 3
l 4 8
l 8 7
l 5 7
l 8 6
l 6 5
l 1 5
l 6 2
l 1 6
l 2 5
l 3 8
l 4 7
l 3 5
l 1 7
l 4 6
l 2 8
l 5 8
l 6 7
l 2 3
l 1 4

@JayFoxRox JayFoxRox mentioned this pull request Sep 6, 2019
auto& x2 = particles[c.b].m_x;
auto delta = x2 - x1;
#if 1
float deltalength = glm::length(delta);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can get unstable and you want to have code to cope with this.

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.

None yet

1 participant