* 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
* 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
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
* Removed some left overs from prior approach.
* Moved _collisionShapeType & getShapeType override from ShapeEntityItem to
RenderableShapeEntityItem (see thread: https://github.com/highfidelity/hifi/pull/11048#discussion_r130154903)
* Switched _collisionShapeType default from SHAPE_TYPE_NONE to SHAPE_TYPE_ELLIPSOID
** see thread: https://github.com/highfidelity/hifi/pull/11048#discussion_r129982909
Note(s):
* Retested and the cylinder behaves as expected along with the Box & Sphere shapes
save from the previously mentioned caveats in the PR notes (https://github.com/highfidelity/hifi/pull/11048)
* Confirmed that currently unsupported shapes (hedrons, polygons, & cone) fallback to
ellipsoid behavior given default change.
Changes Committed:
modified: libraries/entities-renderer/src/RenderableShapeEntityItem.cpp
modified: libraries/entities-renderer/src/RenderableShapeEntityItem.h
modified: libraries/entities/src/ShapeEntityItem.cpp
modified: libraries/entities/src/ShapeEntityItem.h
modified: libraries/shared/src/ShapeInfo.cpp
https://github.com/highfidelity/hifi/pull/11024#pullrequestreview-51611518
Cleans up tabs, moves new functionality out of ShapeFactory directly to
RenderableShapeEntityItem's computeShapeInfo override, begins to break down
where we will need pointlists.
Still need to determine how rotation is handled for pointlists, and check
for axis alignment on cylinders before deciding on a shape.
Changes to be committed:
modified: libraries/entities-renderer/src/RenderableShapeEntityItem.cpp
modified: libraries/entities-renderer/src/RenderableShapeEntityItem.h
modified: libraries/entities/CMakeLists.txt
modified: libraries/entities/src/ShapeEntityItem.cpp
modified: libraries/entities/src/ShapeEntityItem.h
modified: libraries/physics/src/ShapeFactory.cpp
modified: libraries/physics/src/ShapeFactory.h
modified: libraries/shared/src/ShapeInfo.cpp
modified: scripts/developer/tests/basicEntityTest/entitySpawner.js
* Addresses physics library dependency by moving computeShapeInfo override from
ShapeEntityItem (which is within Entities Library) to RenderableShapeEntityItem
(which is in Entities-Renderer Library).
** Entities-Renderer library already links against the physic library.
** Per discussion with Andrew Meadows: In order to ShapeEntityItem to be
utilized the library dependency between the Entity and Physics library
would need to be resolved to avoid the cyclical reliance which isn't in
the scope of this ticket.
* Updates shapeSpawner test script from the default clone of basicEntityTest\entitySpawner.js
** Objects now have a finite lifetime
** Script now cleans up the objects created when the script ends
** Also moved some adjustable properties out into var aliases at the top of the
file for easier/less error prone tweaking. Should probably add one for the shapeType.
* Fixes some issues with validateShapeType helper function
* Removed naive attempt at including physics library within entities library.
* Transferred some todos from notes
* Fixed some formatting
NOTE(s):
This compiles and runs. Cylinder is spawned and treated as CYLINDER_Y.
TODO(s):
* Add tweakable var for shapeType within shapeSpawner.js
* Vet and verify other shapes.
* Add in edge case handling.
* Add in support for other shapes to ShapeInfo infrastructure.
Changes to be committed:
modified: libraries/entities-renderer/src/RenderableShapeEntityItem.cpp
modified: libraries/entities-renderer/src/RenderableShapeEntityItem.h
modified: libraries/entities/CMakeLists.txt
modified: libraries/entities/src/ShapeEntityItem.cpp
modified: libraries/entities/src/ShapeEntityItem.h
modified: libraries/physics/src/ShapeFactory.cpp
modified: libraries/shared/src/ShapeInfo.cpp
modified: scripts/developer/tests/basicEntityTest/shapeSpawner.js
Revised approach involves creating a helper function within ShapeFactory to aid
in devising the ShapeType to be used by an ShapeEntityItem for collision. The
ShapeFactory is currently doing this for creating the actual Bullet Library
collision shapes.
ShapeEntityItem overrides its virtually inherited computeShapeInfo which
in turn calls the new ShapeFactory helper function.
ShapeEntityItem has a new memvar _collisionShapeType to cache its actual
ShapeType used by the physics system. This memvar is returned via the getShapeType
accessor which is expected to return an object's ShapeType.
Note(s):
This is similar to the original approach save translation between entity::Shape and ShapeType
isn't tied to the EntityItemProperties shapeTypeNames or shapeType. This approach more
directly solves the issue of getting the actual ShapeType used by the time it's needed
to determine the bullet collision object type created when initializing the physic information.
Translation of the ShapeEntityItem's entity::Shape to its ShapeType is handled by
ShapeFactory which handles creating the bullet collision objects when setting up
physics on the ShapeEntityItems.
Known Issue(s):
This doesn't compile. It appears that the Entity Library needs to know about
the Physics Library. The naive attempt at providing that link failed to resolve
all compilation issues.
Current Error:
C1083: Cannot open include file: btBulletDynamicsCommon.h:
No such file or directory (C:\projects\cusack\libraries\entities\src\ShapeEntityItem.cpp)
C:\projects\cusack\libraries\physics\src\ShapeFactory.h 15 1 entities
modified: libraries/entities-renderer/src/RenderableShapeEntityItem.cpp
modified: libraries/entities/CMakeLists.txt
modified: libraries/entities/src/ShapeEntityItem.cpp
modified: libraries/entities/src/ShapeEntityItem.h
modified: libraries/physics/src/ShapeFactory.cpp
modified: libraries/physics/src/ShapeFactory.h
modified: libraries/physics/src/ShapeInfo.cpp
modified: scripts/developer/tests/basicEntityTest/entitySpawner.js
new file: scripts/developer/tests/basicEntityTest/shapeSpawner.js