%tutorialhelp%

Introduction

This tutorial will continue from the previous one. Do not start with the usual base code. Instead, start up exactly where Intermediate Tutorial 2 left off. This tutorial will be covering the basics of selecting entities in the scene. It will also cover ways of restricting what is selectable.

The full source for this tutorial is here.

Note: There is also source available that uses the BaseApplication framework and Ogre 1.7 here.

Note: There is also source available that uses the BaseApplication framework, Ogre 1.7, and the builtin SdkTrays overlay system here.

robots_and_ninjas_visual.png

Prerequisites

This tutorial assumes that you already know how to set up an Ogre project and compile it successfully. Knowledge of the topics from previous tutorials is also assumed.

This tutorial is a continuation of Intermediate Tutorial 2. The base code for this tutorial is here.

Highlighting a Selected Entity

The first thing we want to do is make it possible to highlight a selected entity. In your own serious applications, you will most likely want to use something like projective decals or changing the color of the entity's mesh, but we will use the basic bounding box visualization provided by Ogre.

Setting up this bounding box is easy. When the left mouse button is pressed, we will check to see if there was already a previous entity selected. Add the following to the if statement that checks for the left mouse button in mousePressed:

if (mCurObject)
  mCurObject->showBoundingBox(false);

That will turn off the bounding box for any previously selected entity. Now add the following code right before the return statement:

if (mCurObject)
  mCurObject->showBoundingBox(true);

This will turn on the bounding box for any entity that was just selected. That's it. Compile and run the application. You should now see the current entity highlighted with a wireframe box.

bounding_box_visual.png

Ninjas!

Now we want to modify the code so that we can also create ninjas. We will have a "Robot Mode" and a "Ninja Mode". We will use the spacebar to switch between them.

First, let's add a boolean variable that will keep track of what mode we are in.

BasicApp.h
bool bRobotMode;

Now initialize the variable to true so that we start in Robot Mode.

BasicApp.cpp
bRobotMode(true)

We need to make sure that the right kind of entity is created based on our current mode. Find the following in mousePressed:

Entity* ent = mSceneMgr->createEntity("robot.mesh");

We will replace this with code that takes our current mode into account.

Ogre::Entity* ent;
 
if (bRobotMode)
{
  ent = mSceneMgr->createEntity("robot.mesh");
}
else
{
  ent = mSceneMgr->createEntity("ninja.mesh");
}

Now we need to toggle the mode when the spacebar is pressed. Add the following to keyPressed:

if(ke.key == OIS::KC_SPACE)
  bRobotMode = !bRobotMode;

The last thing we'll do is simply for convenience. We already have a CEGUI label that tells us the terrain is building, but we don't use it for anything after that. Let's have it display what mode we are in so the user can know what they will place next.

Find this line in frameRenderingQueued:

terrainLabel->setText("");

And change it to this:

if (mRobotMode)
  terrainLabel->setText("Robot Mode");
else
  terrainLabel->setText("Ninja Mode");

That's all there is to it. Compile and run the application. You should be able to switch between placing robots and ninjas. The current mode should also be displayed in the label.

Selecting Entities

We are now going to use ray scene queries to select entities in our scene. The result of our query will be a RaySceneQueryResult, which is an iterable collection of RaySceneQueryResultEntry structs.

This struct contains three variables. The distance variable tells us how far down the ray our object is. The movable and worldFragment variables tell us what kind of object was hit by the ray. With the old terrain system, testing for world fragments was how we would do raycasts against the terrain. The new terrain system makes this method obsolete. But the movable variable is still used to determine when a ray has hit any entity attached to a scene node (notice that this includes things like the camera). If an entity was hit, then movable will contain a MovableObject. Usually, we will get the scene node for our MovableObject by calling getParentSceneNode or getParentNode.

Let's look at an example to help clarify these concepts. The example would print out everything that was discovered by a ray scene query.

// Do not add this to your project
RaySceneQueryResult& result = mRayScnQuery->execute();
RaySceneQueryResult::iterator it;
 
for (it = result.begin(); it != result.end(); it++)
{
  if (it->worldFragment)
  {
    Vector3 location = it->worldFragment->singleIntersection;
    std::cout << "WorldFragment: (" << 
      location.x << ", " << location.y << ", " << location.z << ")" << std::endl;
  }
  else if (it->movable)
  {
    std::cout << "MovableObject: " << it->movable->getName() << std::endl;
  }
}

Using the new terrain system, we would not get any worldFragment results, even when clicking on the terrain. It's been left it in simply for completeness. But we would still get MovableObject results if our ray hit one of the entities we've placed in our scene.

Now let's actually add these concepts into our application. To get started, let's add a few more variables to our class. Add the following to the header:

BasicApp.h
bool mMovableFound;

Ogre::RaySceneQuery* mRayScnQuery;

Then add these initializations:

BasicApp.cpp
mMovableFound(false),
mRayScnQuery(0)

We now have to reorganize our mousePressed function. First, find the code that starts with this line:

Ogre::TerrainGroup::RayResult terrainResult =

And ends with this:

mCurObject->attachObject(ent);

We're going to wrap this in an if statement that checks to see if mMovableFound is false.

if (!mMovableFound)
{ 
  Ogre::TerrainGroup::RayResult terrainResult =
  ...
  mCurObject->attachObject(ent);
}

Now we need to get into setting up and using our ray scene query. Add the following right before the if statement we just added:

CEGUI::Vector2f mousePos = 
  context.getMouseCursor().getPosition();
 
Ogre::Ray mouseRay =
  mCamera->getCameraToViewportRay(
    mousePos.d_x / float(me.state.width),
    mousePos.d_y / float(me.state.height));

mRayScnQuery->setRay(mouseRay);
mRayScnQuery->setSortByDistance(true);

Ogre::RaySceneQueryResult& result = mRaySceneQuery->execute();
Ogre::RaySceneQueryResult::iterator it = result.begin();

mMovableFound = false;

The first thing we do is give our mouseRay to our ray scene query. It requires this to do the raycast. Next, we tell it to return the results sorted by distance. Otherwise, they would come back in a seemingly random order for performance reasons.

Then we actually execute the query and save a reference to the result. We also get an iterator pointing to the first position in the collection. The last thing we do is "reset" our flag that keeps track of whether or not we've found a MovableObject.

Now we have to look through the results of our query.

for ( ; it != result.end(); it++)
{
  mMovableFound =
    it->movable &&
    it->movable->getName() != "" &&
    it->movable->getName() != "PlayerCam";

  if (mMovableFound)
  {
    mCurObject = it->movable->getParentSceneNode();
    break;
  }
}

For each RaySceneQueryResult, we first check to make sure it is one of our robot/ninja entities. The camera is also attached to a scene node, so we want to ignore that result, and if you run tests on your current scene, you'll notice there appears to be other entities with no name floating around your scene. We must also discard these entities as invalid (they are not terrain elements either, try clicking on the sky and you'll still get some results).

Next, we update our currently selected object if we have found a valid movable object. After that, we break from the loop, because we've found what we're looking for.

Finally, we should make sure to clean up the RaySceneQuery. Add the following to ~BasicApp:

mSceneMgr->destroyQuery(mRayScnQuery);

That is actually all we have to do. That's pretty impressive! Imagine trying to accomplish all of this by calculating all of these rays and manipulating all of the matrices involved.

Compile and run the application. You should be able to reselect entities that you've already placed into the world, while still being able to create new entities when clicking on empty terrain.

Selecting Specific Types of Entities

That last major part of this tutorial is going to deal with masking our selection. This means only selecting certain entities. We want to be able to select robots only when we're in Robot Mode and select ninjas only when we're in Ninja Mode. This is actually very easy to do if we understand a little bit about binary operations.

The first thing we are going to do is add an enum to our class. Add the following to the public section of our header:

BasicApp.h
enum QueryFlags
{
  ROBOT_MASK = 1 << 0,
  NINJA_MASK = 1 << 1
};

The technique we are going to use is called bitmasking. It is a very widely used concept in programming. It makes use of the bitwise operators that most languages provide for changing individual bits in a byte (or at least they simulate it). Wikipedia has a pretty good introduction to the topic here. It is something worth understanding well.

The technique allows us to pack a lot of information into a small amount of data. What we're doing with the enum is declaring two values using the bitwise "shift" operator. This takes a binary number and shifts the bits by a certain number of places. So our ROBOT_MASK value is going to be the number one shifted zero places to the left, and our NINJA_MASK is going to be the number one shifted one place to the left.

ROBOT_MASK = 0000 0001
NINJA_MASK = 0000 0010

These will be used to uniquely identify each type of entity. The next step is to set the query flags for our entities. Update the entity creation code in mousePressed so that it looks like this:

if (mRobotMode)
{
  ent = mSceneMgr->createEntity("robot.mesh");
  ent->setQueryFlags(ROBOT_MASK);
}
else
{
  ent = mSceneMgr->createEntity("ninja.mesh");
  ent->setQueryFlags(NINJA_MASK);
}

The only thing we've changed is the addition of the setQueryFlags methods. This method takes the enum values we set up. The last thing we need to do is to tell our ray scene query when to use each mask. Add the following to mousePressed right after we call setSortByDistance:

mRayScnQuery->setQueryMask(mRobotMode ? ROBOT_MODE : NINJA_MASK);

That is all there is to it. Compile and run your application. You should only be able to select an entity when you are in the corresponding mode.

This is the end of the main tutorial. The rest is supplemental information about further making use of bitmasks with Ogre. It is some very useful information, but it will not add anything new to the code.

More on Masks

We are going to describe some other useful techniques for working with these masks. The code from this point forth will not be added to our project, because most of it requires adding more to the scene. But these techniques should give you a number of ideas on how to customize the application we've already built. Especially once you've learned more about building your scene from later tutorials.

Query Type Masks

There are many other kinds of movable object that can used in your raycasts. For instance, if you were using a BillboardSet or a ParticleSystem, then the raycasts we've been using would ignore those elements in your scene. You may or may not want things to work that way. This is where query type masks come in.

A query type mask allows you to decide what type of objects are to be included in your query. By default, the ray scene query has its mask set to ENTITY_TYPE_MASK. This only returns entities you've placed in your scene. To recognize effects like the particle system, we would use the following:

mRayScnQuery->setQueryTypeMask(Ogre::SceneManager::FX_TYPE_MASK);

The scene manager defines six query type mask values:

WORLD_GEOMETRY_TYPE_MASK   // returns world geometry
ENTITY_TYPE_MASK           // returns entities (default)
FX_TYPE_MASK               // returns BillboardSets/ParticleSystems.
STATICGEOMETRY_TYPE_MASK   // returns static geometry
LIGHT_TYPE_MASK            // returns lights
USER_TYPE_MASK_LIMIT       // user type mask limit

Combining Masks

It is often useful to combine masks so we can select objects from more than one group with the same query. This is easily accomplished by using another bitwise operator. The bitwise | (OR) operator allows us to combine masks. Let's say we had a set of query flags like this:

enum QueryFlags
{
  NPC = 1 << 0,
  ENEMY = 1 << 1,
  ITEM = 1 << 2,
};

If we wanted to to select both NPCs and ITEMS we could set the mask like this:

mRayScnQuery->setQueryMask(NPC | ITEM);

Now mRayScnQuery would return movable objects with either NPC or ITEM masks. You can start to see why these bitmasks are so useful. If you have a particular combination that you use a lot, then you can even assign it a new name in your enum for convenience:

enum QueryFlags
{
  NPC = 1 << 0,
  ENEMY = 1 << 1,
  ITEM = 1 << 2,
  NONHOSTILE = NPC | ITEM,
}

Negation of a Mask

The bitwise operator ~ flips every bit in the number. This is bitwise negation. It is equivalent to or'ing together every mask except the one you are negating. Here's an example:

mRayScnQuery->setQueryMask(~ENEMY);

This is exactly equivalent to our previous example with bitwise OR. The ~ENEMY mask would have all of its bits on except for ENEMY. For our example, that is exactly the same as NPC | ITEM.

Finally, we can combine these bitwise operations. What if we wanted to return everything except NPCs and ITEMs? We could do this by combining bitwise negation and bitwise OR.

mRayScnQuery->setQueryMask(~(NPC | ITEM));

One last trick you can do with negation is create a query that returns every kind of movable object. The trick is to negate the number zero. By doing this you get the mask of all ones. This is functionally equivalent to mask you'd get by using bitwise OR on every mask in your enum.

mRayScnQuery->setQueryMask(~0);

In our example, this is equivalent to:

mRayScnQuery->setQueryMask(NPC | ENEMY | ITEM);

Note: To avoid confusion, it should be pointed out that the binary numbers ~0 and NPC | ENEMY | ITEM would not be equivalent. It is just that they will have the equivalent effect in our example because we are not using any of the places where they are different. The actual values would be:

NPC | ENEMY | ITEM = 0000 0000 0000 0111
~0                 = 1111 1111 1111 1111

The important part is that they match for the lowest three positions, because that is all our example was using.

If a lot of these bitmasking examples have been confusing, then you should seriously consider doing some supplemental reading along with these tutorials. If you have a solid handle on the mathematics, it will help you immensely as a programmer. And if you try and get by without it, then you will be constantly struggling with trying to understand two subjects at once. Make your life easier, study some math.

Conclusion

This tutorial was a continuation of the previous tutorial about using raycasts in your scene. We introduced the full ray scene query process for building a raycast and searching through the results. We used these queries to reselect entities we had already placed into our scene.

This lead us to controlling what entities would be selected. The problem was solved by the use of bitmasks. Bitmasking is a widely-used technique that allows us to make use of the concept of individual bits to keep track of data instead of always using full bytes. We learned about a series of bitwise operations which allow us to quickly create complicated bit patterns representing collections of entities to be used in our raycasts.

Exercises

Easy

  1. Choose some of the techniques introduced in the More About Masks section and update your scene to use them in any way you choose.

Intermediate

  1. Since we are creating multiples types of objects now, we should be using the concept of a Factory to properly create our Entities and SceneNodes. Implement this design pattern.

Difficult

  1. One bug in our current design is that no matter where you select an entity, our application will consider it like you are holding the model from the very bottom. To make this more clear, just try it in your application. Grab a model by the top and then move the mouse slightly. If your cursor is still over some terrain, then the model will fly far across the terrain. This is because it is trying to place the bottom of the model where your cursor is. Fix this issue.
  2. Our application only allows two types of entities. In a real scene editor, you would want to be able to choose from a customizable list of entities. Use CEGUI to create GUI elements that allow you to chose from a number of different entities to place onto the terrain.
  3. After you've completed the previous exercise, then allow the user to use the GUI to select what types of entities are active. You will be using techniqes that are covered in the More About Masks section after the main tutorial.

Advanced

  1. Add the ability to select multiple objects by holding the Ctrl key and clicking on a number of different entities. Also make it so that moving one of these selected entities moves the entire group.
  2. Many strategy games allow you to create persistent groups of entities that can be selected automatically and moved together. Implement this feature in your program using CEGUI.

Full Source

The full source for this tutorial is here.

Next

Intermediate Tutorial 4


Alias: Intermediate_Tutorial_3

<HR>
Creative Commons Copyright -- Some rights reserved.


THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.

BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.

1. Definitions

  • "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
  • "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
  • "Licensor" means the individual or entity that offers the Work under the terms of this License.
  • "Original Author" means the individual or entity who created the Work.
  • "Work" means the copyrightable work of authorship offered under the terms of this License.
  • "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
  • "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.

2. Fair Use Rights

Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.

3. License Grant

Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:

  • to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
  • to create and reproduce Derivative Works;
  • to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
  • to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
  • For the avoidance of doubt, where the work is a musical composition:
    • Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
    • Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
    • Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).


The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.

4. Restrictions

The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:

  • You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(c), as requested.
  • You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-ShareAlike 2.5 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
  • If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.

5. Representations, Warranties and Disclaimer

UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.

6. Limitation on Liability.

EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

7. Termination

  • This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
  • Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.

8. Miscellaneous

  • Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
  • Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
  • If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
  • No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
  • This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.