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

Water mesh is too small #29

Open
IstuntmanI opened this issue Jun 28, 2017 · 4 comments
Open

Water mesh is too small #29

IstuntmanI opened this issue Jun 28, 2017 · 4 comments

Comments

@IstuntmanI
Copy link
Contributor

IstuntmanI commented Jun 28, 2017

In "src/WaterArray.h":

{ -10000.0, 10000.0, 0.0, 3000.0, 10000.0, 0.0, -10000.0, 3000.0, 0.0 },
{ 3000.0, 10000.0, 0.0, 10000.0, 10000.0, 0.0, 10000.0, -3000.0, 0.0 },
{ 10000.0, -3000.0, 0.0, 10000.0, -10000.0, 0.0, -3000.0, -10000.0, 0.0 },
{ -10000.0, 3000.0, 0.0, -10000.0, -10000.0, 0.0, -3000.0, -10000.0, 0.0 },
{ -10000.0, 3000.0, 0.0, 3000.0, 10000.0, 0.0, 3000.0, 3000.0, 0.0 },
{ 3000.0, 10000.0, 0.0, 10000.0, -3000.0, 0.0, 3000.0, -3000.0, 0.0 },
{ -3000.0, -3000.0, 0.0, 10000.0, -3000.0, 0.0, -3000.0, -10000.0, 0.0 },
{ -10000.0, 3000.0, 0.0, -3000.0, 3000.0, 0.0, -3000.0, -10000.0, 0.0 }

All those +- 10000 values should be set to infinity. By default, the world boundaries are ( -20000, -20000, 20000, 20000 ), so players can go behind those +- 10000 values by default. World boundaries could be increased, so I think that this would be ok:

{ - ( ( float ) 0x7F800000 ), ( float ) 0x7F800000, 0.0, 3000.0, ( float ) 0x7F800000, 0.0, - ( ( float ) 0x7F800000 ), 3000.0, 0.0 },
{ 3000.0, ( float ) 0x7F800000, 0.0, ( float ) 0x7F800000, ( float ) 0x7F800000, 0.0, ( float ) 0x7F800000, -3000.0, 0.0 },
{ ( float ) 0x7F800000, -3000.0, 0.0, ( float ) 0x7F800000, - ( ( float ) 0x7F800000 ), 0.0, -3000.0, - ( ( float ) 0x7F800000 ), 0.0 },
{ - ( ( float ) 0x7F800000 ), 3000.0, 0.0, - ( ( float ) 0x7F800000 ), - ( ( float ) 0x7F800000 ), 0.0, -3000.0, - ( ( float ) 0x7F800000 ), 0.0 },
{ - ( ( float ) 0x7F800000 ), 3000.0, 0.0, 3000.0, ( float ) 0x7F800000, 0.0, 3000.0, 3000.0, 0.0 },
{ 3000.0, ( float ) 0x7F800000, 0.0, ( float ) 0x7F800000, -3000.0, 0.0, 3000.0, -3000.0, 0.0 },
{ -3000.0, -3000.0, 0.0, ( float ) 0x7F800000, -3000.0, 0.0, -3000.0, - ( ( float ) 0x7F800000 ), 0.0 },
{ - ( ( float ) 0x7F800000 ), 3000.0, 0.0, -3000.0, 3000.0, 0.0, -3000.0, - ( ( float ) 0x7F800000 ), 0.0 }

or a bit nicer:

// top
#define FLOAT_INFINITY ( ( float ) 0x7F800000 )

// array
{ -FLOAT_INFINITY, FLOAT_INFINITY, 0.0, 3000.0, FLOAT_INFINITY, 0.0, -FLOAT_INFINITY, 3000.0, 0.0 },
{ 3000.0, FLOAT_INFINITY, 0.0, FLOAT_INFINITY, FLOAT_INFINITY, 0.0, FLOAT_INFINITY, -3000.0, 0.0 },
{ FLOAT_INFINITY, -3000.0, 0.0, FLOAT_INFINITY, -FLOAT_INFINITY, 0.0, -3000.0, -FLOAT_INFINITY, 0.0 },
{ -FLOAT_INFINITY, 3000.0, 0.0, -FLOAT_INFINITY, -FLOAT_INFINITY, 0.0, -3000.0, -FLOAT_INFINITY, 0.0 },
{ -FLOAT_INFINITY, 3000.0, 0.0, 3000.0, FLOAT_INFINITY, 0.0, 3000.0, 3000.0, 0.0 },
{ 3000.0, FLOAT_INFINITY, 0.0, FLOAT_INFINITY, -3000.0, 0.0, 3000.0, -3000.0, 0.0 },
{ -3000.0, -3000.0, 0.0, FLOAT_INFINITY, -3000.0, 0.0, -3000.0, -FLOAT_INFINITY, 0.0 },
{ -FLOAT_INFINITY, 3000.0, 0.0, -3000.0, 3000.0, 0.0, -3000.0, -FLOAT_INFINITY, 0.0 }

By the way, I downloaded the latest colandreas.inc from the Releases page and it is bugged. Also, files should come in an archive, just like the previous version.

@Crayder
Copy link
Collaborator

Crayder commented Jul 3, 2017

By the way, I downloaded the latest colandreas.inc from the Releases page and it is bugged. Also, files should come in an archive, just like the previous version.

Yeah for some reason GitHub keeps appending the old include when I upload a new one. Even when I delete and reupload it. I've tried many times!

@Crayder
Copy link
Collaborator

Crayder commented Jul 3, 2017

And about the water, not sure if infinite polygons are a great idea. If anything I think we should set them to 20000.0. That is the boundary we should all stay in no matter what.

@IstuntmanI
Copy link
Contributor Author

Well, you could test infinite polygons for the water mesh. This would be the proper way to do it, as the margin water is most probably infinite in GTA. I think that bulletPhysics supports that. If you won't make it infinite, make it 30000.0, just in case. I don't think too many developers extended the world boundaries past 20000.0. Those boundaries aren't a solid wall, but something that is pushing you back, so the limit should be at least 20050.0 I guess (maybe you could push the limit a bit with an airplane ? didn't test that).

@Crayder
Copy link
Collaborator

Crayder commented Jul 9, 2017

Players can go past the boundary no problem, the problem is the syncing bugs and slight side effects that occur past 20000. It's best to stick to these boundaries not to encourage going past it. Bullet can most definitely support infinite it's just not really recommended within SA-MP. I'd be fine with setting the boundary to 20000 though.

Crayder pushed a commit that referenced this issue Jan 8, 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

No branches or pull requests

2 participants