How can I overload constructors?

Problems building or running the engine, queries about how to use features etc.
Post Reply
r0ut
Halfling
Posts: 44
Joined: Mon Feb 22, 2021 6:25 pm
x 2

How can I overload constructors?

Post by r0ut »

Ogre Version: 1.12

I'm not familiar with SWIG and I've encountered this problem at ShadowCameraSetupPtr. The constructor should accept an ShadowCameraSetup as argument but instead it shows SWIGTYPE_p_std__nullptr_t.

Code: Select all

using System;

namespace org.ogre
{
    public class ShadowCameraSetupPtr : IDisposable
    {
        protected bool swigCMemOwn;

        public ShadowCameraSetupPtr();
        public ShadowCameraSetupPtr(SWIGTYPE_p_std__nullptr_t arg0);
        ...
Is there a way to overload this constructor or if should I change SWIG interface, how can I do it?
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: How can I overload constructors?

Post by paroj »

you are not supposed to create the *Ptr classes yourself. Use e.g. FocusedShadowCameraSetup.create instead.
r0ut
Halfling
Posts: 44
Joined: Mon Feb 22, 2021 6:25 pm
x 2

Re: How can I overload constructors?

Post by r0ut »

Is this what you mean?

Code: Select all

PSSMShadowCameraSetup pssmSetup = new PSSMShadowCameraSetup();
pssmSetup.setSplitPadding(1);
pssmSetup.setOptimalAdjustFactor(0, 2);

mPSSMSetup = FocusedShadowCameraSetup.create(); //This
Post Reply