Comments (2)
I believe dropping the field accessors in favor of real array composition will also facilitate use of SSE and other parallel processing capabilities. But if this change is going to happen, it needs to happen IMO before launch so less users had to rewrite their code from using .x
and .y
to using [0]
and [1]
.
from playrho.
This is done now and passes all builds/tests as of commit aad9ebb.
So no more access to Vec2
or Length2D
etc via .x
or .y
.
If a programmer wants to access elements by horizontal or vertical concepts, the template functions GetX
and GetY
are there now for that. If a programmer wants to access elements by array concepts, the template functions std::get<0>
and std::get<1>
are there now for this (and implemented for the base Vector template structure). These are all compile-time safe too in that their setup is such that the compiler should output an error if you were to try and do something like access element 4 via code like std::get<4>
. I think these should be the recommended ways to access the Vector
based types.
Alternatively, the Vector
based types can all be accessed like arrays; with subscripts. Like: location[0]
or location[1]
. Out-of-bounds access as arrays is not guaranteed to be caught by the compiler however.
from playrho.
Related Issues (20)
- UnitVec isn't generalized to N dimensions
- Testbed Test subclasses all in header files
- "vector<bool> subscript out of range" in WorldImpl HOT 5
- PlayRho and LiquidFun
- Remove all public functions that take a non-const Body reference. HOT 3
- CMake: export of targets not used at all in config file HOT 2
- Fix code scanning alert - Returning stack-allocated memory HOT 1
- Some unit test failures on Apple M2 Silicon
- UnderlyingValue deprecated warnings in release 1.1.0 Testbed build
- Release 1.1.0 Testbed warns about using OpenGL functions on macOS deprecated since 10.14
- Warnings on building Testbed from uses of *sprintf
- benchmark submodule not based on v1.7.1 or newer
- AppVeyor doesn't run for release-1.1.1 branch HOT 1
- Get*JointConf functions incorrectly marked noexcept
- Checked class template support for non-throwing for known valid values HOT 1
- Performance regression introduced or former bug fixed? HOT 1
- Use custom container allocators in WorldImpl HOT 3
- Move WorldImpl under detail namespace HOT 1
- Move Island under detail namespace HOT 1
- CMake fix in install rules HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playrho.