<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.1.92">
</HEAD>
<BODY>
Hi the list,<BR>
I'm experimenting the pdata-op function with particles with simple velocity.<BR>
All was going well.<BR>
I even reduce the particles size to disappear.<BR>
But I got stuck on operations on colours.<BR>
<BR>
Here are the errors I have:<BR>
<BR>
(pdata-op "+" "c" (vector 0 0.1 0))<BR>
>AddOperator has no operator for types: PN6Fluxus10TypedPDataINS_7dColourEEE and N6Fluxus7dVectorE<BR>
<BR>
(pdata-op "+" "c" (vector 0 0.1 0 1))<BR>
>AddOperator has no operator for types: PN6Fluxus10TypedPDataINS_7dColourEEE and N6Fluxus7dColourE<BR>
<BR>
So, I searched and found this AddOperator function in sources, and tried to add these specific types.<BR>
Here is the corresponding patch for (pdata-op "+" "c" (vector 0 0.1 0))<BR>
<BR>
<BR>
---------------------- libfluxus/src/PDataArithmetic.cpp ----------------------<BR>
index 8879667..99fd974 100644<BR>
@@ -79,6 +79,19 @@ PData *AddOperator::Operate(TypedPData<dVector> *a, TypedPData<dVector> *b)<BR>
        return NULL;<BR>
 }<BR>
 <BR>
+template <><BR>
+PData *AddOperator::Operate(TypedPData<dColour> *a, dVector b)<BR>
+{<BR>
+       for (vector<dColour,FLX_ALLOC(dColour) >::iterator i=a->m_Data.begin(); i!=a->m_Data.end(); i++)<BR>
+       {<BR>
+               i->r+=b.x;<BR>
+               i->g+=b.y;<BR>
+               i->b+=b.z;<BR>
+//             i->A=i.A;<BR>
+       }<BR>
+       return NULL;<BR>
+}<BR>
+<BR>
 ////////////////////////////////////////////////////////////////////////////<BR>
 <BR>
 template <><BR>
<BR>
----------------------- libfluxus/src/PDataArithmetic.h -----------------------<BR>
index fccce02..1ea4f37 100644<BR>
@@ -62,6 +62,8 @@ template<><BR>
 PData *AddOperator::Operate(TypedPData<dVector> *a, TypedPData<float> *b);<BR>
 template<><BR>
 PData *AddOperator::Operate(TypedPData<dVector> *a, TypedPData<dVector> *b);<BR>
+template<><BR>
+PData *AddOperator::Operate(TypedPData<dColour> *a, dVector b);<BR>
 <BR>
 class MultOperator : public PDataOperator<BR>
 {<BR>
<BR>
<BR>
<BR>
<BR>
Proud of my creation, I recompile, no compile errors, launch the script, and I get the same error.<BR>
Did I missed a declaration somewhere, or is it totally wrong?<BR>
<BR>
Thanks for any clue on this.<BR>
<BR>
<BR>
Cheers Ted.<BR>
<BR>
<BR>
ps: I made a demo for a vj contest with my fluxus work. If you want to checkout : <A HREF="http://vimeo.com/vjbros/astrobros">http://vimeo.com/vjbros/astrobros</A>
</BODY>
</HTML>