CognitiveVR / cvr-sdk-unity

Cognitive3D SDK for Unity - Analytics for VR/AR/MR
http://cognitive3d.com
Other
42 stars 12 forks source link

Consistent dynamic id using SHA 256 #151

Closed AtifMahmud closed 8 months ago

AtifMahmud commented 8 months ago

Description

This enables a way to have consistent custom ids for dynamic objects. Developers can enable this option by adding C3D_USE_DETERMINISTIC_DYNAMIC_ID in the project settings or in the Cognitive3D runtime assembly definition file.

This algorithm uses SHA-256 with the mesh name as an input. The first 32 characters of the output is taken and formatted.

Examples of mesh names and corresponding ids:

  1. capsule : 881df12b-68cd-344e-83f6-b83d6e0eea5
  2. sphere: : 0f58b78b-c54e-0c3e-5556-8ec522fb67b

If C3D_USE_DETERMINISTIC_DYNAMIC_ID not added, the custom id option will use a GUID which will be different every time.

Height Task ID(s) (If applicable): https://c3d.height.app/T-3609

Type of change

Checklist