When computing the buffer view offset for ShapeData the vertex vector
size should be scaled by a single vec3 size as opposed to 2.
This fix is taken from PR discussion:
https://github.com/1P-Cusack/hifi/pull/10
Proposed by: Andrew Meadows <andrew@highfidelity.io>
Changes Committed:
modified: libraries/render-utils/src/GeometryCache.cpp
The entity dimensions should be scaled by 1 as opposed to 0.5.
Changes Committed:
modified: interface/src/Util.cpp
modified: libraries/render-utils/src/GeometryCache.cpp
modified: libraries/render-utils/src/GeometryCache.h
* Renamed squared var to be consistent with format of others in the code base.
* Removed fabsf() that was accidentally left in.
* Reduced squared distance filter within GeometryCache::computeSimpleHullPointListForShape
as suggested from 0.0025f to recommended 1.0e-6f (1mm^2).
Feedback Link: https://github.com/highfidelity/hifi/pull/11336#pullrequestreview-70060918
Changes Committed:
modified: libraries/render-utils/src/GeometryCache.cpp
* Adjusts GeometryCache::computeSimpleHullPointListForShape to utilize
ShapeData::_positionView as opposed to _normalView.
** Also filters out duplicate points or points close enough to be considered
duplicate vertices. This provides ShapeFactory with better point data
and should reduce hits to the dedupe pass within createConvexHull.
Tested:
* Octagon & Tetrahedron
** They looked better than the prior commit, behaved closer to their shape as opposed
to cone or narrow cylinder like.
Note:
* These changes are based on debug info observations using the Octagon and
discussion with Andrew Meadows via Slack & https://github.com/highfidelity/hifi/pull/11336#pullrequestreview-69939120
Changes Committed:
modified: libraries/render-utils/src/GeometryCache.cpp
modified: libraries/render-utils/src/GeometryCache.h
* Added remaining cylinder/capsule shapes to computeVolume
* Point lists are generated during computeShapeInfo, so shouldn't
need to be cleared within setParams.
** setSphere/setBox appear to be clear as they're used in tests or
in local scopes without using point data.
Reviewed-by: Leander Hasty <leander@1stplayable.com>
Changes Committed:
modified: libraries/shared/src/ShapeInfo.cpp
Generates hashes for Simple Hull instances by incorporating their
point list into the hash as opposed to the extents.
Reviewed-by: Leander Hasty <leander@1stplayable.com>
Changes Committed:
modified: libraries/shared/src/ShapeInfo.cpp
* Fixes int vs size_t comparison warning within ShapeInfo.
* Fixes unused var warning for shapeVerts local var within GeometryCache.
This should fix the mac & ubuntu builds.
Changes Committed:
modified: libraries/render-utils/src/GeometryCache.cpp
modified: libraries/shared/src/ShapeInfo.cpp
Shape isn't guaranteed to be permanent and thus the triangle count isn't
guaranteed to be the same since inception, so grab it each time.
Changes to be committed:
modified: libraries/entities-renderer/src/RenderableShapeEntityItem.cpp
* Fixes an issue where ShapeEntityItem's collisionShapeType wasn't updated when its
entity::Shape type was changed.
* Adds getNameForShapeType static method to ShapeInfo.
** Moves shapeTypeNames[] from EntityItemProperties.cpp to ShapeInfo.cpp
* Adds collisionShapeType to ShapeEntityItem::debugDump
* Tested creating shapes within the Creation Menu:
** Create Menu -> (Box/Sphere)
*** Observe Properties tab auto-focus
** From Properties tab elect alternate shape type from the Shape Dropdown list.
NOTE: While this fixes an issue with the collision shape, it doesn't completely
resolve the issues seen with the polyhedra or polygonal shapes noticed on
RELEASE-7130 rebase.
Reviewed-by: Leander Hasty <leander@1stplayable.com>
Changes Committed:
modified: libraries/entities/src/EntityItemProperties.cpp
modified: libraries/entities/src/ShapeEntityItem.cpp
modified: libraries/shared/src/ShapeInfo.cpp
modified: libraries/shared/src/ShapeInfo.h
As of Commit b93e91b9, render-utils no longer knows about entity lib.
This commit adjusts for that by altering the signature of
GeometryCache::computeSimpleHullPointListForShape to take in portions
of ShapeEntityItem data as opposed to the entity pointer.
Fixes build failure mentioned in:
https://github.com/highfidelity/hifi/pull/11336#issuecomment-333635794
Reviewed-by: Leander Hasty <leander@1stplayable.com>
Changes Committed:
modified: interface/src/Util.cpp
modified: libraries/render-utils/src/GeometryCache.cpp
modified: libraries/render-utils/src/GeometryCache.h
* Removes todos from ShapeEntityItem::shapeCalculator stub commit.
* Removes defined out debugging, as requested, from GeometryCache::computeSimpleHullPointListForShape.
* Moves cone handling to its own section for better contextual flow.
Changes Committed:
modified: libraries/entities/src/ShapeEntityItem.cpp
modified: libraries/render-utils/src/GeometryCache.cpp
* Switched direct map indexing to helper function which has out of bounds safeguard.
* Also updated GeometryCache::getShapeForEntityShape default fallback return from
GeometryCache::NUM_SHAPES to GeometryCache::Sphere inline with general preference
to act as if a shape is a sphere in the event of an error.
Changes Committed:
modified: libraries/render-utils/src/GeometryCache.cpp
This commit adds support for the polyhedrons and polygons sans
Torus and Quad which aren't currently supported within GeometryCache.
* Moves GeometryCache::_shapes from public to private scope
* Nothing aside from the class should be directly altering this, only querying
* Updated instances of direct referencing which looks to have been limited to prior
testing of instancing and shapes.
* Adds an accessor function for ShapeData to GeometryCache
* Consolidates point list generation to helper function
* GeometryCache::computeSimpleHullPointListForShape
* Moves GeometryCache::Shape to entity::Shape mapping to GeometryCache from
RenderableShapeEntityItem
* Adds conversion accessor to GeometryCache, GeometryCache::Shape getShapeForEntityShape
* Sets ShapeEntityItem::ShapeInfoCalculator callback committed earlier.
* This helps circumvent the issue with library inclusion. entity-render knows about
entity; however, entity doesn't know about entity-renderer; however, GeometryCache
data is needed within entity::ShapeEntityItem to compose the ShapeInfo point list data.
* This callback is set up within Application::init of the Interface as it knows about
both halves of the equation, and the callback needs to be setup prior to any entities
collision data getting generated.
* Removes _type reset within ShapeInfo::setPointCollection
* This should avoid any issues due to subversively setting the type or
incorrectly setting the type as a tangential operation.
* Audited instances of ShapeInfo::setPointCollection and all seemed to be
calling the function immediately after having set the type via
ShapeInfo::setParams
* Adds new ShapeType: SHAPE_TYPE_CIRCLE
* This type is reserved for the circle which is now treated as a special
type of Cylinder_Y with regard to collision as opposed to a simple hull.
* Fixes the issue where jumping on a circle, at times, would
result in the avatar sliding off towards an edge as if atop a
squished cone.
* Also updates ShapeInfo::getType() to return ShapeType as opposed to int
* Auditing calls showed that majority of places were comparing against ShapeType
* ShapeType::_type is a ShapeType so returning the type explicitly
is more consistent.
* ShapeInfo file houses ShapeType enum so any file aware of ShapeInfo is aware of
ShapeType enumeration.
* entity::Quad defaults to SHAPE_TYPE_ELLIPSOID
* Like entity::Shape::Torus, entity::Shape::Quad is currently unsupported within
GeometryCache::buildShapes.
* Also it appears that a Quad shape can't be created within world via the creation menu.
* There's no explicit option at present to create one.
* Trying subvert the Cube/Box creation option to generate one results in an enforced
stubby box as opposed to a quad.
* Given the aforementioned points, entity::Shape::Quad will default to
SHAPE_TYPE_ELLIPSOID as opposed to SHAPE_TYPE_BOX.
* Added Todo regarding the shape being unsupported along with a notation to create
a special ShapeType, SHAPE_TYPE_QUAD, for it should it be added in the future.
* Adds some comments and has some minor clean up.
Reviewed-by: Leander Hasty <leander@1stplayable.com>
Changes Committed:
modified: interface/src/Application.cpp
modified: interface/src/Util.cpp
modified: interface/src/Util.h
modified: libraries/entities-renderer/src/RenderableShapeEntityItem.cpp
modified: libraries/entities/src/ShapeEntityItem.cpp
modified: libraries/entities/src/ShapeEntityItem.h
modified: libraries/physics/src/ShapeFactory.cpp
modified: libraries/render-utils/src/GeometryCache.cpp
modified: libraries/render-utils/src/GeometryCache.h
modified: libraries/shared/src/ShapeInfo.cpp
modified: libraries/shared/src/ShapeInfo.h
modified: tests/gpu-test/src/TestInstancedShapes.cpp