Exemple #1
0
Quadmesh::Quadmesh() :
Nu(64),
Nv(64),
Ns(1),
index(nullptr),
position(nullptr),
scalar(nullptr)
{
    shaderController->loadFromGlsl(BinaryData::QuadmeshSurfaceShader_glsl);
    setName("Quadmesh");
    lastSolidColorName = Colours::red.toString();
    lastWiredColorName = Colours::black.toString();
    
    vertexPositionsFunction = nullptr;
    vertexScalarsFunction = nullptr;
    vertexPositionsTable = nullptr;
    vertexScalarsTable = nullptr;
    evaluateVertexData();

    addTrait("renderAsWireframe", false, this);
    addTrait("resolution", 16, this);
    addTrait("solidColor", lastSolidColorName, this);

    /* just shader variables, don't need this to listen */
    addTrait("drawMesh", true);
    addTrait("meshOutlinesWidth", 0.05);
    addTrait("meshOutlinesSoftness", 0.05);
    addTrait("useScalarForHeight", false);
    addTrait("useScalarForColor", false);
}
//public caller to add trait
void Personality::addTrait(std::string key)
{
	stTrait tr = Traits::Instance()->getTrait(key);
	if(tr.name != "empty")
	{
		addTrait(tr);
	}
}
Exemple #3
0
Module::Module(ProgramSource * src, StringRef qual)
  : Defn(Mod, this, "<module>")
  , IterableScope(NULL)
  , moduleSource_(src)
  , entryPoint_(NULL)
  , programStartup_(NULL)
  , flags_(Module_Reflect)
  , timestamp_(0, 0)
  , irModule_(NULL)
{
  loc.file = src;
  qname_ = qual;
  addTrait(Singular);
  setScopeName(qual);
}
Exemple #4
0
Module::Module(StringRef qual, Scope * builtinScope)
  : Defn(Mod, this, "<module>")
  , IterableScope(builtinScope)
  , moduleSource_(NULL)
  , entryPoint_(NULL)
  , programStartup_(NULL)
  , flags_(Module_Reflect)
  , timestamp_(0, 0)
  , irModule_(NULL)
{
  loc.file = NULL;
  setQualifiedName(qual);
  addTrait(Singular);
  setScopeName(moduleStrings_.intern(qual));

  if (DebugXDefs == qual) {
    flags_ |= Module_Debug;
  }

  if (NoReflect) {
    flags_ &= ~Module_Reflect;
  }
}