Beta release 3.1b
Moderator: Moderators
Another suggestion (of minor importance): global float variables defined in ZLibrary should be used as sources of values for e.g. in RenderText.TextFloatRef and other similar properties. If they are used in this way in the current ZGE beta, they cause corrupting of the project file which cannot be opened without manual fixing in text editor. Thanks.
Hi Ville, I fully understand, thanks. BTW here's another possible improvement:
The most common thing appearing in ZgeBullet 3D physical simulation is to set position and rotation of a Model according to the computed simulated values. At the moment the functions such as
are called in a quite cumbersome way:
I would appreciate much compact form:
At the moment, ZGE reports "Cannot get address of expression: ((vec3)CurrentModel.Position)" syntax error for function call. Would it be possible to access vec3 properties of components in this way?
Another improvement: In ZGEBox2D are usually updated just X and Y components of Position. What about to:
? In this case I would expect to set just X and Y items; no syntax error.
The most common thing appearing in ZgeBullet 3D physical simulation is to set position and rotation of a Model according to the computed simulated values. At the moment the functions such as
Code: Select all
int zbtGetPosition(int collisionObjectId, ref float x, ref float y, ref float z) {}
Code: Select all
zbtGetPosition(ObjectId, CurrentModel.Position.X, CurrentModel.Position.Y, CurrentModel.Position.Z);
Code: Select all
definition:
int zbtGetPosition(int collisionObjectId, ref vec3 pos) {}
usage:
zbtGetPosition(ObjectId. CurrentModel.Position)
Another improvement: In ZGEBox2D are usually updated just X and Y components of Position. What about to:
Code: Select all
call this declaration:
zb2GetPosition(int body, ref vec2 pos) {}
in this way:
zb2GetPosition(BodyId, CurrentModel.Position);
Hi Rado1,
Although this isn't the best / a real solution, and you probably thought of this already .. you could write a ZLibrary for those kind of things. For example ..
.. and ..
K
Although this isn't the best / a real solution, and you probably thought of this already .. you could write a ZLibrary for those kind of things. For example ..
Code: Select all
int bulletGetPosition(int id, ref vec3 position)
{
return zbtGetPosition(id, position.x, position.y, position.z);
}
Code: Select all
void box2DGetPosition(int id, ref vec3 position)
{
position.x = zb2GetPositionX(id);
position.y = zb2GetPositionY(id);
}
Even if vec3 syntax would be accepted it would not work because a ZGE vec3 is not the same as a C++ float[3], instead it is a automatically memory managed structure that maps to a ZGE Array object. So it would not have the memory layout that C++ expects.
I would instead try:
zbtGetPosition(int collisionObjectId, xptr pos)
Because "xtpr" instructs ZGE to pass a pointer to the underlying data which in this case would be the actual float[3] position value of a Model.Position. Let me know if that doesn't work.
edit: and if "model.position" is not xptr compatible, try passing "model.position.x" and treat it as a float[3] pointer on the C++ side.
I would instead try:
zbtGetPosition(int collisionObjectId, xptr pos)
Because "xtpr" instructs ZGE to pass a pointer to the underlying data which in this case would be the actual float[3] position value of a Model.Position. Let me know if that doesn't work.
edit: and if "model.position" is not xptr compatible, try passing "model.position.x" and treat it as a float[3] pointer on the C++ side.
Last edited by VilleK on Fri May 30, 2014 1:17 pm, edited 1 time in total.
Thanks, BTW the idea of "ref float pos" works fine. However, it's not very intuitive for usage at the side of ZGE and I would prefer to pass"model.Position" directly, if possible.VilleK wrote:I'll check the xptr issue. New suggestion, try: try declaring as "ref float pos", pass "model.position.x" and treat it as a float[3] pointer on the C++ side.
@jonaspm: Thanks for noticing, I fixed it now. It had timeout value set too low.
@Rado1: I've fixed the WebOpen component so that it can now work with binary files, as you reported here: viewtopic.php?p=6889#6889
http://www.zgameeditor.org/files/ZGameEditor_beta.zip
@Rado1: I've fixed the WebOpen component so that it can now work with binary files, as you reported here: viewtopic.php?p=6889#6889
http://www.zgameeditor.org/files/ZGameEditor_beta.zip
- xptr syntax extended (passing Model.Position to xptr should work now)
- Fixed "App.CameraPosition=GlobalVarV3;" syntax.
- vec*/mat4 types included in editor autosuggestions.
http://www.zgameeditor.org/files/ZGameEditor_beta.zip
- Fixed "App.CameraPosition=GlobalVarV3;" syntax.
- vec*/mat4 types included in editor autosuggestions.
http://www.zgameeditor.org/files/ZGameEditor_beta.zip