this is more compact:
+ magsq_ov = dot(ov, ov);
There are two occurrences of this pattern.
Instead of declaring 'temp_hits[0..1]' you can reuse the 'hits[0..1]'
variable. This should decrease the amount of stack space required.
Instead of:
+ if (skip_to_hemispheres == false) {
You can use:
+ if (!skip_to_hemispheres) {
You need to re-check the 'if (check_v)' and 'if (check_h)' branches because
the code is not 100% equivalent to that in part_shot().
In the normal computation code 'part_norm' don't change 'hitp->hit_vpriv.z'
like the current C code does. Copy the vector to a temporary variable and
modify that. Otherwise code which calls the normal computation function
more than once will get incorrect values. We may change this later when the
curvature code gets implemented.
Status: open-works-for-me Group: Incomplete Created: Mon Jun 06, 2016 06:42 AM UTC by Param Hanji Last Updated: Mon Jun 06, 2016 06:42 AM UTC Owner: Vasco Alexandre da Silva Costa Attachments:
I made a couple of minor changes to the patch as suggested. Regarding the 'check_v' and 'check_h', I needed to restructure the code slighly as the ANSI C version contains goto statements. I haven't changed the logic too much, and the required operations are still performed.
Let me know if you see a flaw in the logic or feel that the current implementation may fail.
I made a couple of minor changes to the patch as suggested. Regarding the
'check_v' and 'check_h', I needed to restructure the code slighly as the
ANSI C version contains goto statements. I haven't changed the logic too
much, and the required operations are still performed.
Let me know if you see a flaw in the logic or feel that the current
implementation may fail.
Status: open-works-for-me Group: Incomplete Created: Mon Jun 06, 2016 06:42 AM UTC by Param Hanji Last Updated: Mon Jun 06, 2016 06:42 AM UTC Owner: Vasco Alexandre da Silva Costa Attachments:
Some comments. Instead of:
+ magsq_ov = ov.xov.x + ov.yov.y + ov.z*ov.z;
this is more compact:
+ magsq_ov = dot(ov, ov);
There are two occurrences of this pattern.
Instead of declaring 'temp_hits[0..1]' you can reuse the 'hits[0..1]'
variable. This should decrease the amount of stack space required.
Instead of:
+ if (skip_to_hemispheres == false) {
You can use:
+ if (!skip_to_hemispheres) {
You need to re-check the 'if (check_v)' and 'if (check_h)' branches because
the code is not 100% equivalent to that in part_shot().
In the normal computation code 'part_norm' don't change 'hitp->hit_vpriv.z'
like the current C code does. Copy the vector to a temporary variable and
modify that. Otherwise code which calls the normal computation function
more than once will get incorrect values. We may change this later when the
curvature code gets implemented.
Everything else looks great.
On Mon, Jun 6, 2016 at 7:42 AM, Param Hanji catchchaos@users.sf.net wrote:
--
Vasco Alexandre da Silva Costa
PhD in Computer Engineering (Computer Graphics)
Instituto Superior Técnico/University of Lisbon, Portugal
Related
Patches:
#446I made a couple of minor changes to the patch as suggested. Regarding the 'check_v' and 'check_h', I needed to restructure the code slighly as the ANSI C version contains goto statements. I haven't changed the logic too much, and the required operations are still performed.
Let me know if you see a flaw in the logic or feel that the current implementation may fail.
Check all the code paths on a piece of paper. The execution traces on those
branches are not 100% the same.
On Mon, Jun 6, 2016 at 6:40 PM, Param Hanji catchchaos@users.sf.net wrote:
--
Vasco Alexandre da Silva Costa
PhD in Computer Engineering (Computer Graphics)
Instituto Superior Técnico/University of Lisbon, Portugal
Related
Patches:
#446Made some more changes. Tell me if this is fine.
I refactored the patch a bit so the control flow looks more similar to the ANSI C code. I also removed some code which modified the hit_vpriv field.