History

add lifetime and tag arguments to actions

Seth Alves committed 11 years ago

Commit 7c6846c1 parent ba317a09 files · +106 −14Browse files

Showing the changes to libraries/physics/src/ObjectActionSpring.cpp (1 of 9 files). Show all

Unified · Split

libraries/physics/src/ObjectActionSpring.cpp+10−1
@@ -109,6 +109,9 @@ void ObjectActionSpring::updateActionWorker(btScalar deltaTimeStep) { · 108 unmodified lines
109109 const float MIN_TIMESCALE = 0.1f;
110110
111111 bool ObjectActionSpring::updateArguments(QVariantMap arguments) {
112+ if (!ObjectAction::updateArguments(arguments)) {
113+ return false;
114+ }
112115 // targets are required, spring-constants are optional
113116 bool ok = true;
114117 glm::vec3 positionalTarget =
@@ -155,7 +158,7 @@ bool ObjectActionSpring::updateArguments(QVariantMap arguments) { · 40 unmodified lines
155158 }
156159
157160 QVariantMap ObjectActionSpring::getArguments() {
158− QVariantMap arguments;
161+ QVariantMap arguments = ObjectAction::getArguments();
159162 withReadLock([&] {
160163 arguments["linearTimeScale"] = _linearTimeScale;
161164 arguments["targetPosition"] = glmToQMap(_positionalTarget);
@@ -182,6 +185,9 @@ QByteArray ObjectActionSpring::serialize() const { · 20 unmodified lines
182185 dataStream << _angularTimeScale;
183186 dataStream << _rotationalTargetSet;
184187
188+ dataStream << _expires;
189+ dataStream << _tag;
190+
185191 return serializedActionArguments;
186192 }
187193
@@ -210,5 +216,8 @@ void ObjectActionSpring::deserialize(QByteArray serializedArguments) { · 22 unmodified lines
210216 dataStream >> _angularTimeScale;
211217 dataStream >> _rotationalTargetSet;
212218
219+ dataStream >> _expires;
220+ dataStream >> _tag;
221+
213222 _active = true;
214223 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t