mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 03:53:34 +02:00
WIP -adding canCastShadow flag.
This commit is contained in:
parent
26e7a85a95
commit
adb02d69f9
6 changed files with 19 additions and 12 deletions
libraries/entities/src
EntityItemProperties.cppEntityItemProperties.hEntityItemPropertiesDefaults.hModelEntityItem.hShapeEntityItem.h
scripts/system/html/js
|
@ -878,6 +878,7 @@ void EntityItemProperties::merge(const EntityItemProperties& other) {
|
|||
COPY_PROPERTY_IF_CHANGED(angularVelocity);
|
||||
COPY_PROPERTY_IF_CHANGED(angularDamping);
|
||||
COPY_PROPERTY_IF_CHANGED(visible);
|
||||
COPY_PROPERTY_IF_CHANGED(canCastShadow);
|
||||
COPY_PROPERTY_IF_CHANGED(color);
|
||||
COPY_PROPERTY_IF_CHANGED(colorSpread);
|
||||
COPY_PROPERTY_IF_CHANGED(colorStart);
|
||||
|
@ -1050,6 +1051,7 @@ void EntityItemProperties::entityPropertyFlagsFromScriptValue(const QScriptValue
|
|||
|
||||
std::call_once(initMap, [](){
|
||||
ADD_PROPERTY_TO_MAP(PROP_VISIBLE, Visible, visible, bool);
|
||||
ADD_PROPERTY_TO_MAP(PROP_CAN_CAST_SHADOW, CanCastShadow, canCastShadow, bool);
|
||||
ADD_PROPERTY_TO_MAP(PROP_POSITION, Position, position, glm::vec3);
|
||||
ADD_PROPERTY_TO_MAP(PROP_DIMENSIONS, Dimensions, dimensions, glm::vec3);
|
||||
ADD_PROPERTY_TO_MAP(PROP_ROTATION, Rotation, rotation, glm::quat);
|
||||
|
@ -2172,6 +2174,9 @@ QList<QString> EntityItemProperties::listChangedProperties() {
|
|||
if (visibleChanged()) {
|
||||
out += "visible";
|
||||
}
|
||||
if (canCastShadowChanged()) {
|
||||
out += "canCastShadow";
|
||||
}
|
||||
if (rotationChanged()) {
|
||||
out += "rotation";
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ public:
|
|||
DEFINE_PROPERTY_REF(PROP_SCRIPT, Script, script, QString, ENTITY_ITEM_DEFAULT_SCRIPT);
|
||||
DEFINE_PROPERTY(PROP_SCRIPT_TIMESTAMP, ScriptTimestamp, scriptTimestamp, quint64, ENTITY_ITEM_DEFAULT_SCRIPT_TIMESTAMP);
|
||||
DEFINE_PROPERTY_REF(PROP_COLLISION_SOUND_URL, CollisionSoundURL, collisionSoundURL, QString, ENTITY_ITEM_DEFAULT_COLLISION_SOUND_URL);
|
||||
DEFINE_PROPERTY(PROP_CAN_CAST_SHADOW, CanCastShadow, canCastShadow, bool, ENTITY_ITEM_DEFAULT_CAST_SHADOW);
|
||||
DEFINE_PROPERTY(PROP_CAN_CAST_SHADOW, CanCastShadow, canCastShadow, bool, ENTITY_ITEM_DEFAULT_CAN_CAST_SHADOW);
|
||||
DEFINE_PROPERTY_REF(PROP_COLOR, Color, color, xColor, particle::DEFAULT_COLOR);
|
||||
DEFINE_PROPERTY_REF(PROP_COLOR_SPREAD, ColorSpread, colorSpread, xColor, particle::DEFAULT_COLOR_SPREAD);
|
||||
DEFINE_PROPERTY_REF(PROP_COLOR_START, ColorStart, colorStart, xColor, particle::DEFAULT_COLOR);
|
||||
|
@ -415,6 +415,7 @@ inline QDebug operator<<(QDebug debug, const EntityItemProperties& properties) {
|
|||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Velocity, velocity, "in meters");
|
||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Name, name, "");
|
||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Visible, visible, "");
|
||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, CanCastShadow, canCastShadow, "");
|
||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Rotation, rotation, "");
|
||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Density, density, "");
|
||||
DEBUG_PROPERTY_IF_CHANGED(debug, properties, Gravity, gravity, "");
|
||||
|
|
|
@ -46,7 +46,8 @@ const quint32 ENTITY_ITEM_DEFAULT_STATIC_CERTIFICATE_VERSION = 0;
|
|||
const float ENTITY_ITEM_DEFAULT_ALPHA = 1.0f;
|
||||
const float ENTITY_ITEM_DEFAULT_LOCAL_RENDER_ALPHA = 1.0f;
|
||||
const bool ENTITY_ITEM_DEFAULT_VISIBLE = true;
|
||||
const bool ENTITY_ITEM_DEFAULT_CAST_SHADOW { true };
|
||||
const bool ENTITY_ITEM_DEFAULT_CAST_SHADOWS { true };
|
||||
const bool ENTITY_ITEM_DEFAULT_CAN_CAST_SHADOW { false };
|
||||
|
||||
const QString ENTITY_ITEM_DEFAULT_SCRIPT = QString("");
|
||||
const quint64 ENTITY_ITEM_DEFAULT_SCRIPT_TIMESTAMP = 0;
|
||||
|
|
|
@ -174,7 +174,7 @@ protected:
|
|||
|
||||
ShapeType _shapeType = SHAPE_TYPE_NONE;
|
||||
|
||||
bool _canCastShadow{ ENTITY_ITEM_DEFAULT_CAST_SHADOW };
|
||||
bool _canCastShadow{ ENTITY_ITEM_DEFAULT_CAN_CAST_SHADOW };
|
||||
|
||||
private:
|
||||
uint64_t _lastAnimated{ 0 };
|
||||
|
|
|
@ -115,7 +115,7 @@ protected:
|
|||
//! ellipsoids.
|
||||
ShapeType _collisionShapeType{ ShapeType::SHAPE_TYPE_ELLIPSOID };
|
||||
|
||||
bool _canCastShadow { ENTITY_ITEM_DEFAULT_CAST_SHADOW };
|
||||
bool _canCastShadow { ENTITY_ITEM_DEFAULT_CAN_CAST_SHADOW };
|
||||
};
|
||||
|
||||
#endif // hifi_ShapeEntityItem_h
|
||||
|
|
|
@ -802,11 +802,11 @@ function loaded() {
|
|||
|
||||
// HTML workaround since image is not yet a separate entity type
|
||||
var IMAGE_MODEL_NAME = 'default-image-model.fbx';
|
||||
var urlParts = properties.modelURL.split('/')
|
||||
var propsFilename = urlParts[urlParts.length - 1];
|
||||
if (properties.type === "Model" && propsFilename === IMAGE_MODEL_NAME) {
|
||||
properties.type = "Image";
|
||||
}
|
||||
//// var urlParts = properties.modelURL.split('/')
|
||||
//// var propsFilename = urlParts[urlParts.length - 1];
|
||||
//// if (properties.type === "Model" && propsFilename === IMAGE_MODEL_NAME) {
|
||||
//// properties.type = "Image";
|
||||
//// }
|
||||
|
||||
// Create class name for css ruleset filtering
|
||||
elPropertiesList.className = properties.type + 'Menu';
|
||||
|
@ -983,11 +983,11 @@ function loaded() {
|
|||
properties.color.green + "," + properties.color.blue + ")";
|
||||
}
|
||||
|
||||
if (properties.type === "Model" ||
|
||||
properties.type === "Shape" || properties.type === "Box" || properties.type === "Sphere") {
|
||||
//if (properties.type === "Model" ||
|
||||
// properties.type === "Shape" || properties.type === "Box" || properties.type === "Sphere") {
|
||||
|
||||
elCanCastShadow = properties.canCastShadow;
|
||||
}
|
||||
//}
|
||||
|
||||
if (properties.type === "Model") {
|
||||
elModelURL.value = properties.modelURL;
|
||||
|
|
Loading…
Reference in a new issue