Jump to content

thehankinator

Members
  • Content Count

    435
  • Joined

  • Last visited

Community Reputation

142 Excellent

About thehankinator

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

4,105 profile views
  1. thehankinator

    Collision table

    Thanks!
  2. thehankinator

    Operators on Vec2 and 4 missing?

    I am creating emitters in code. It's convenient for me to define them in the editor then convert them to code. I don't have to do it this way but a division operator for a Vec4 isn't an uncommon thing in a vector library. Nothing I am doing requires this operator, I've already got a workaround.
  3. thehankinator

    Collision table

    Does anyone have the collision type table? It doesn't exist in the documentation anymore. Or has something changed in resolving collisions? https://www.leadwerks.com/learn?page=API-Reference_Object_Collision
  4. thehankinator

    Operators on Vec2 and 4 missing?

    It'd be handy if Vec4 had a division operator for converting colors defined in 0-255 to 0-1
  5. thehankinator

    Operators on Vec2 and 4 missing?

    I am not able to divide a Vec2 or Vec4 but Vec3 works fine. Seems like this should work, am I wrong? local Case1 = Vec2(164, 0) / 255 --Doesn't work local Case2 = Vec3(164, 0, 0) / 255 --Works local Case3 = Vec4(164, 0, 0, 255) / 255 --Doesn't work Error message for Case1 and 3 is: Attempt to perform operation on an invalid operand
  6. Using this page https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_Emitter_SetMaxScale It isn't clear how many arguments this Lua function accepts. Syntax section states 1 argument But the example has 2 arguments if (window:KeyDown(Key.Up)) then maxscale = maxscale + 1 emitter:SetMaxScale(maxscale,maxscale) elseif (window:KeyDown(Key.Down) and maxscale > 0) then maxscale = maxscale -1 emitter:SetMaxScale(maxscale,maxscale) end The C++ documentation is consistent in that there is a single argument. However the header file "Emitter.h" has two functions listed virtual void SetMaxScale(const float x);//lua virtual void SetMaxScale(const float x, const float y);//lua Seems like both Lua and C++ have 1 and 2 arguments variations but only the 1 argument variant is documented and Lua example shows 2 arguments.
  7. thehankinator

    Sprite:GetAngle() always returns 0

    That makes sense, Thanks!
  8. thehankinator

    Sprite:GetAngle() always returns 0

    Calling GetAngle() on a sprite set to Billboard mode is always returning 0. Here is how I set it up: 1) Create a sprite 2) Set it to Billboard mode 3) Assign a material 4) Put this script on it function Script:UpdateWorld() System:Print(self.entity:GetAngle()) end The billboard appears to be working (always facing the camera) but the script always prints 0. I tried casting it to a sprite ( tolua.cast(self.entity,"Sprite") ) and calling GetAngle on that but no change. Any idea what I am doing wrong?
  9. thehankinator

    Material:SetPickMode broken

    Sorry if this has already been posted but it seems like Material:SetPickMode is broken. For example this code: local mat = Material:Create() local shader = Shader:Load("Shaders/Model/diffuse+alphamask.shader") mat:SetShader(shader) shader:Release() mat:SetPickMode(true) Crashes with this error: attempt to call method 'SetPickMode' (a nil value) Seems like this should work, this is the documentation for the function: https://www.leadwerks.com/learn?page=API-Reference_Object_Asset_Material_SetPickMode
  10. thehankinator

    Custom Cast() function with templates

    I don't know what the signature of CreateBox() is nor what Entity and Model classes look like but this compiles for me under VS2015 and MinGW 5.3.0 (Debug and Release for both). Entity had to have a virtual function to make it polymorphic. #include <memory> class Entity { public: virtual ~Entity() {} }; class Model : public Entity { public: virtual ~Model() {} }; template <class T, class Y> std::shared_ptr<T> Cast(std::shared_ptr<Y> o) { #ifdef DEBUG return std::dynamic_pointer_cast<T>(o); #else return std::static_pointer_cast<T>(o); #endif } std::shared_ptr<Entity> CreateBox() { return std::dynamic_pointer_cast<Entity>(std::make_shared<Model>()); } int main() { std::shared_ptr<Entity> entity = CreateBox(); std::shared_ptr<Model> model = Cast<Model>(entity); return 0; }
  11. thehankinator

    Documentation - Transform:Point()

    https://www.leadwerks.com/learn?page=API-Reference_Object_Math_Transform_Point Two things: 1) Minor thing, the Lua example contains local position = Transform:Point(2,0,0,NULL,model) "NULL" should be "nil". 2) The documentation doesn't say what using NULL/nil means but I think the documentation used to state that it would use global space. This is missing from the other functions in Transform.
  12. thehankinator

    Artifacts when using vegetation

    dark-rocky-big-diff.mat It is also missing Veg Shadow shader
  13. thehankinator

    Artifacts when using vegetation

    I don't remember exactly but I'll get it for you tonight.
  14. thehankinator

    Artifacts when using vegetation

    That was it! Thanks! It would be nice if the editor would give a warning or message when the user selects an object that contains a material that does not have a vegetation shader defined.
  15. thehankinator

    Artifacts when using vegetation

    I picked up The Zone DLC and started poking around with vegetation. After placing various rocks I get these really weird blue/white monoliths. When looking around, they appear to randomly move around or disappear/appear. I've trashed my map and started over a couple times, restarted LE they keep coming back. Also, the rocks in the screenshot disappear as the camera approaches them but appear when backing up. Test.map
×